Skip to content

Nodejs

Posted on:September 23, 2022 at 03:22 PM

ES modules in NodeJS

ES modules in NodeJS

package.json package-lock.json

SEE ALL HTTP verbs:

SQL vs No SQL

Node

It is a runtime base on google chrome v8 engine.

Node process and argv

Node file system module

Node and npm

npm, local vs global package installation

package.json file

Update nodejs using nvm (node version manager)

  1. Install nvm.
$ curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
  1. Activate env variables, you can also open new terminal.
$ source ~/.bashrc
  1. Find available node versions
$ nvm ls-remote
  1. Install required node verison. You can install multiple node versions.
$ nvm install v10.16.2
  1. To set default node version.
$ nvm use v10.16.2
  1. Run Applition with Specific Version
$ nvm run v10.16.2 app.js
  1. Remove unused node version
$ nvm uninstall v10.16.2

npm

Parcel

  if(module.hot) {
  module.hot.accept()
  }

Invoking parcel using npm scripts

Using babel

Modern JS development

Module in JS

Named exports

Default exports

Module pattern and CommnJS modules

- export.addToCart = function() {}
- const { addToCart } = require('./shoppingCart.js')

Polyfilling using Babel