User Tools

Site Tools


npm

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
npm [2020/12/17 10:03] – создано chifeknpm [2023/09/14 06:06] (current) – external edit 127.0.0.1
Line 1: Line 1:
-====== What Is Npm Shrinkwrap And Why You Should Start Using It Right Now? ====== +[[npm shrinkwrap|npm shrinkwrap]]
- +
- +
-I've recently talked to people who are mostly PHP developers and want to try Node.js. For installing and managing dependencies, they use Composer. Composer creates 2 files, composer.json and composer.lock. Composer.json file is similar to package.json in Node.js but what's composer.lock? Here comes npm shrinkwrap+
- +
-NPM shrinkwrap lets you lock down the ver­sions of installed pack­ages and their descen­dant pack­ages. It helps you use same package versions on all environments (development, staging, production) and also improve download and installation speed. Having same versions of packages on all environments can help you test systems and deploy with confidence. If all tests pass on one machine, you can be sure that it will pass on all other because you know that you use same code! +
- +
- +
-====== How To Use It? ====== +
- +
- +
-NPM shrinkwrap is very simple to use. After installing packages using <code>npm install</code>or <code> npm install <package-name> </code> and updating your node_modules folder, you should run +
- +
-<code> npm shrinkwrap </code> +
-That's all! +
- +
-It should create new npm-shrinkwrap.json file with information about all packages you use. Don't forget to commit it! +
- +
-Next time, when someone calls npm install, it will install packages from npm-shrinkwrap.json and you will have the same environment on all machines.+
npm.1608199408.txt.gz · Last modified: 2023/09/14 06:06 (external edit)