Node and npm introduction
This writing provides an overview of Node and npm introduction, concept etc. Some of contents are referred from Node.js books, official webpage for node and npm. To develop the mobile application with ReactNative, this node and npm are the must-to-know things.
1. What is Node?
- There are many opinions about what a node is, but no explanation is more accurate than the one on the official Node website. (https://nodejs.org/en) Node.js is JavaScript runtime environment that lets developers create servers, web apps, command line tools and scripts.
- Node is used when executing various JavaScript application but it is used mostly for server application.
- In addition to server, Node is used Web with Angular, React, Vue, and also for the mobile application with ReactNative that I'm using.
2. What is "Runtime environment"?
- Runtime, specifically, refers to the period or time during which a program is running. The runtime environment is the environment in which a program is running, and provides functions (functions, platform, etc.) for the program to run. Runtime is often interpreted as the runtime environment.
- So the Node, JavaScript runtime environment, can execute the JavaScript program in your computer.
- There are also other JavaScript runtime, such as Bun (https://bun.sh/) or deno (https://deno.com/), but the Node is the mostly used one.
3. What is npm?
- npm is Node Package Manager.
- There are countless JavaScript programmers in the world. They have written a lot of code in advance while walking the same path as you. In addition, they have made that code public so that others can see it. The server where such codes are shared public is npm. (https://www.npmjs.com/)
- Node modules uploaded to npm are called packages. Just as modules can use other modules, packages can also use other packages. This relationship is called a dependency.
4. yarn and pnpm
- There are yarn (https://yarnpkg.com/) and pnpm (https://pnpm.io/) as alternatives to npm. Yarn is a package manager released by Facebook, and you often see it when using frameworks from the Facebook camp, such as React or React Native. Pnpm is a package manager that improves the performance of npm.
- It has some features that improve convenience and performance compared to npm, but it must be installed separately. If the npm server is too slow, you can also consider switching to yarn or pnpm.
Next step
- The next one is about package.json. It will explain how the packages are managed.
Comments
Post a Comment