Skip to content

Commit edcd933

Browse files
authored
doc: update the dependencies vendoring section (#118)
Update the `Use the shrinkwrap` section 2.2 with another approach to vendor dependencies
1 parent a21b3b6 commit edcd933

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,10 @@ The flip side of using `npm-shrinkwrap.json` is the security implications you ar
361361
> Use `npm shrinkwrap` command to generate the shrinkwrap lockfile, which is of the same
362362
> format as that of a `package-lock.json` file.
363363
364+
Another method for vendoring dependencies is to bundle them within the published package, which has the advantage of speeding up installations as it reduces the need to resolve dependencies as well as network requests and bandwidth for download, yet it comes with the disadvantages of being an opaque box for which it is difficult to analyze the dependency tree of the project and result in security tools like Snyk, not reporting vulnerabilities (because Snyk ignores `devDependencies` by default, to reduce noise for developers)
365+
- Packages are declared as `devDependencies`, so that the package managers will not find any production dependencies to install.
366+
- The [ncc](https://www.npmjs.com/package/@vercel/ncc) is used to compile a Node.js module into a single file with all of its dependencies in-lined.
367+
364368
References:
365369

366370
- [Do you really know how a lockfile works for yarn and npm packages?](https://snyk.io/blog/making-sense-of-package-lock-files-in-the-npm-ecosystem/)

0 commit comments

Comments
 (0)