Learn everything about Javascript
- Node should not be used in CPU intensive work.
To manage multiple versions of Node.js
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
- list node versions using
$ nvm list
- Use specific version using
$ nvm use <version_no>
E.g.$ nvm use 16.13.1
- Install a specific version of
node
vianvm install <version_no>
E.g.$ nvm install 14
- Install the latest node via
nvm install node
- Use the latest node via
nvm use node
- Install the latest lts node via
nvm install --lts
- Use the latest lts node via
nvm use --lts
NOTE: LTS: long term support in terms of stable & secure versions.
- Install Node & npm from here
NOTE: Whenever
node
gets installed,npm
also gets installed.
yarn
is relatively faster than npm
because of parallel installation of dependency packages instead of sequential.
So, install using npm
:
npm install -g yarn
OR
curl --compressed -o- -L https://yarnpkg.com/install.sh | bash
Thereafter for a project, yarn
can be used to install, test, coverage, etc, instead of npm
.
To setup in Github Action for a repo, refer this.
-
jshint
can be used to get suggestions for better code injs
.jshint app.js
can be used like this to find suggestions.- M-1:
.jshintrc
file can be added as inline configuration for the entire project in the root directory & adding it this:
{ "esversion": 6 }
- M-2: Also this line can be added at the starting of the
.js
file. Source
- TS boilerplate (bin): https://github.com/abhi3700/ts-boilerplate-bin
- TS boilerplate (lib): https://github.com/abhi3700/ts-boilerplate-lib
- Cause:
yarn.lock
file conflicts are not resolved during PR. - Solution: Just copy paste the
yarn.lock
file from themain
branch & then run$ yarn install
& then push commit. Your lock file is synced now.