Package detail

npm-bundled

npm47.6mISC4.0.0

list things in node_modules that are bundledDependencies, or transitive dependencies thereof

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:

const bundled = require('npm-bundled')

// async version
bundled({ 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
})

// async promise version
bundled({ 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
})

// sync version, throws if there's an error
const list = bundled.sync({ 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.

changelog

Changelog

4.0.0 (2024-09-24)

⚠️ BREAKING CHANGES

  • npm-bundled now supports node ^18.17.0 || >=20.5.0

    Bug Fixes

  • 099af07 #102 align to npm 10 node engine range (@hashtagchris)

    Dependencies

  • 5a83713 #102 npm-normalize-package-bin@4.0.0

    Chores

  • 9709604 #102 run template-oss-apply (@hashtagchris)
  • fe37e08 #99 bump @npmcli/eslint-config from 4.0.5 to 5.0.0 (@dependabot[bot])
  • ae1bb99 #100 postinstall for dependabot template-oss PR (@hashtagchris)
  • b211ca0 #100 bump @npmcli/template-oss from 4.23.1 to 4.23.3 (@dependabot[bot])

3.0.1 (2024-05-06)

Bug Fixes

  • fdc7518 #87 linting: no-unused-vars (@lukekarrys)

Documentation

  • aee7cab #84 readme: fix broken badge URL (#84) (@10xLaCroixDrinker)

Chores

  • e7ae896 #89 auto publish (#89) (@lukekarrys)
  • 38c91f7 #87 bump @npmcli/template-oss to 4.22.0 (@lukekarrys)
  • 070a724 #86 create separate cwd test (@lukekarrys)
  • 240ecbd #44 deps: remove mkdirp and rimraf (#44) (@lukekarrys, @wraithgar)
  • acfc9f4 #87 postinstall for dependabot template-oss PR (@lukekarrys)
  • bbfc416 #86 bump @npmcli/template-oss from 4.21.3 to 4.21.4 (@dependabot[bot])

3.0.0 (2022-10-14)

⚠️ BREAKING CHANGES

  • npm-bundled is now compatible with the following semver range for node: ^14.17.0 || ^16.13.0 || >=18.0.0

Features

  • 7682b9e #23 postinstall for dependabot template-oss PR (@lukekarrys)

Dependencies

  • 3a21cbe #30 bump npm-normalize-package-bin from 2.0.0 to 3.0.0

2.0.1 (2022-08-25)

Dependencies

  • bump npm-normalize-package-bin from 1.0.1 to 2.0.0 (#13) (aec07c1)

2.0.0 (2022-08-22)

⚠ BREAKING CHANGES

  • This adds an engine field with support for node ^12.13.0 || ^14.15.0 || >=16.0.0.

Documentation

  • fix incorrect example of sync usage (#9) (45ccdf4)

Dependencies