Last active
August 6, 2018 16:27
-
-
Save silversonicaxel/77a1a897ca70d83ad965 to your computer and use it in GitHub Desktop.
NODE #node #nodejs #packagejson
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // create a package.json file asking for | |
| // - name (node) | |
| // - version (1.0.0) | |
| // - description () | |
| // - author () | |
| npm init | |
| // version of npm installed | |
| npm -v | |
| // update version of npm | |
| npm install npm -g | |
| // look for package.json and install modules | |
| npm install | |
| // install the node package locally into the machine, it will be executable with package.json bin parameter | |
| npm install -g | |
| //install module globally | |
| npm install <module> -g | |
| //install module in the current directory | |
| npm install <module> | |
| //install module and save it to the package.json dependencies | |
| npm install --save <module> | |
| //install module and save it to the package.json devDependencies | |
| npm install --save-dev <module> | |
| //delete module from package.json and node_modlues/ | |
| npm uninstall <module> | |
| //search module name into the repository | |
| npm search <module> | |
| //list of global node modules installed | |
| npm list --global | |
| npm list --global --depth=0 | |
| //cleaning cache of node (because node the first time it installs a module, it keeps locally a copy of it, specifically that version) | |
| npm cache clean | |
| // login in npm registry with username, password and public email | |
| npm login | |
| // publish or update in npm registries an npm package | |
| npm publish |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "Application", | |
| "version": "1", | |
| "description": "Description", | |
| "author": "Author", | |
| "dependencies": { | |
| "module1": "latest", | |
| "module2": "1.8.7", | |
| "module3": "~1", | |
| "module4": "~1.8", | |
| "module5": "~1.8.7" | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "module1": "latest", # latest version from github repository | |
| "module2": "1.8.7", # major version . minor version . patch version | |
| "module3": "~1", # 1.0.0 <= version < 2.0.0 | |
| "module4": "~1.8", # 1.8.7 <= version < 1.9.0 | |
| "module5": "~1.8.7" # 1.8.7 <= version < 1.9.0 safe version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment