{"id":15292020,"url":"https://github.com/devmasen/learning-npm","last_synced_at":"2026-04-12T20:33:44.818Z","repository":{"id":255905025,"uuid":"853839304","full_name":"DevMasen/learning-npm","owner":"DevMasen","description":"NPM important notes and commands","archived":false,"fork":false,"pushed_at":"2024-09-08T18:43:49.000Z","size":49,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-29T15:12:33.303Z","etag":null,"topics":["learning","nodejs","npm"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DevMasen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-07T17:17:52.000Z","updated_at":"2024-09-08T18:43:53.000Z","dependencies_parsed_at":"2024-09-07T19:56:30.336Z","dependency_job_id":null,"html_url":"https://github.com/DevMasen/learning-npm","commit_stats":null,"previous_names":["devmasen/learning-npm"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevMasen%2Flearning-npm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevMasen%2Flearning-npm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevMasen%2Flearning-npm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevMasen%2Flearning-npm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DevMasen","download_url":"https://codeload.github.com/DevMasen/learning-npm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245247417,"owners_count":20584346,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["learning","nodejs","npm"],"created_at":"2024-09-30T16:16:12.052Z","updated_at":"2026-04-12T20:33:44.779Z","avatar_url":"https://github.com/DevMasen.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e Node Package Manager Guide \u003cimg src=\"./img/icons8-npm-48.png\" \u003e \u003c/h1\u003e\n\n## Commands :\n\n1. `npm init` : initialize npm for local project by asking questions and create package.json\n1. `npm init -y` or `npm init --yes` : initializing npm for local project with difault values and create package.json\n1. `npm i \u003cpackageName\u003e [\u003cpackage2Name\u003e]...[--save]` or `npm install \u003cpackageName\u003e [\u003cpackage2Name\u003e]...[--save]`: install dependencies(packages) for project and add them to node_modules and package.json \n1. `npm uninstall \u003cpackageName\u003e` or `npm un \u003cpackageName\u003e` : uninstall a dependency(package) from project and remove it from node_modules and package.json\n1. `npm remove \u003cpackageName\u003e` or `npm rm \u003cpackageName\u003e` : remove(uninstall) a package\n1. `npm i` : install all required packages for project that specified in package.json (create node_modules)\n1. `npm i \u003cpackageName\u003e@\u003cmajorVersion\u003e.[\u003cminorVersion\u003e].[\u003cpatchVersion\u003e]` : install a specific version of a package.\n1. `npm i \u003cpackageName\u003e --save-dev` or `npm i \u003cpackageName\u003e -D` : install a dependency(package) in development phase (project can run without it)\n1. `npm i \u003cpackageName\u003e -g` : install a package for project globaly and accesible on all drives(path: 'C:\\Users\\mhow3\\AppData\\Roaming\\npm\\node_modules')\n1. `npm uninstall \u003cpackageName\u003e -g` : uninstall a package globaly\n1. `npm list` : log all dependencies to last depth\n1. `npm list --depth \u003cN\u003e` : log dependencies in a specific depth (\\\u003cN\u003e)\n1. `npm [config] set init-\u003cinitial-property\u003e \"initialValue\"` : set a default value for npm package.json properties\n1. `npm [config] get init-\u003cinitial-property\u003e` : get a property of package.json\n1. `npm run \u003ccustomScript\u003e` : run a custom script that wrote in package.json \"scripts\"\n1. `node \u003cjavascriptFileName\u003e` : run a javascript file with node.js\n1. `tsc \u003ctypescriptFile\u003e` : transport a typescript file into javascript file\n1. `tsc \u003ctypescriptFile\u003e -w` : transport and watch a typescript file into javascript\n1. `npm update` : update packages to the last version toward one of these character before version in package.json (^ : patch and minor , ~ : patch only , * : major and minor and patch)\n1. `npx parcel \u003cindex.html\u003e` : build a webapp with parcel\n1. `npm audit` : scan packages for find vulnerabilities of them\n1. `npm audit fix` : fix all vulnerabilities in packages\n\n\n## Notes :\n- #### npx(Node Package Execute) : run package that have not been installed on project\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevmasen%2Flearning-npm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevmasen%2Flearning-npm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevmasen%2Flearning-npm/lists"}