npm/npm-bundled

Name: npm-bundled

Owner: npm

Description: null

Created: 2017-05-27 09:07:21.0

Updated: 2018-05-18 15:55:28.0

Pushed: 2018-01-04 04:19:23.0

Homepage: null

Size: 24

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

npm-bundled

Run this in a node package, and it'll tell you which things in node_modules are bundledDependencies, or transitive dependencies of bundled dependencies.

Build Status

USAGE

To get the list of deps at the top level that are bundled (or transitive deps of a bundled dep) run this:

t bundled = require('npm-bundled')

sync version
led({ path: '/path/to/pkg/defaults/to/cwd'}, (er, list) => {
 er means it had an error, which is _hella_ weird
 list is a list of package names, like `fooblz` or `@corp/blerg`
 the might not all be deps of the top level, because transitives


sync promise version
led({ path: '/path/to/pkg/defaults/to/cwd'}).then(list => {
 so promisey!
 actually the callback version returns a promise, too, it just
 attaches the supplied callback to the promise


ync version, throws if there's an error
t list = bundled({ path: '/path/to/pkg/defaults/to/cwd'})

That's basically all you need to know. If you care to dig into it, you can also use the bundled.Walker and bundled.WalkerSync classes to get fancy.

This library does not write anything to the filesystem, but it may have undefined behavior if the structure of node_modules changes while it's reading deps.

All symlinks are followed. This means that it can lead to surprising results if a symlinked bundled dependency has a missing dependency that is satisfied at the top level. Since package creation resolves symlinks as well, this is an edge case where package creation and development environment are not going to be aligned, and is best avoided.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.