node modules : further details Flashcards
external node modules
npm is a source of obtaining third party modules
will be installed in node_modules folder
npm is a source of obtaining third party modules
will be installed in node_modules folder
require(“name/relatepath”) function
starting file for the node module
root for all the files and folder
index.js
you will see this in all node modules
package.json
to create package.json
use npm init
version number is specified as
3 digits
semantic versioning numbering system
major.minor.patch
major version - additional features added and not necessarily be backward compatible
minor version - both bug fix and some enhancement added but backward compatible
patch version - bug fix issued
devDependencies
used only when developing
install exact particular version
npm install express@4.0.0
install patch version higher than specified number available
npm install express@”~4.0.0”
minor version acceptable
npm install express@”^4.0.0”
Node modules
File based - allow us to design our own modules
Core node modules - provides certain basic functionalities - fs, os, path, util
External modules