Recursively gathers names and versions of installed dependencies
The different between this package and similar existing packages is it relies entirely on your package.json
and that of your dependencies installed in node_modules
. Other packages (e.g. lsmod) use things like require.cache
which is dependent on runtime of your app.
yarn add ls-installed-deps
# or npm
npm install ls-installed-deps
const lsDeps = require('ls-installed-deps')
lsDeps(opts)
//> { lodash: '4.17.11' }
String
Default: process.cwd()
Boolean
Default: false
Include devDependencies in the result
Boolean
Default: false
Instead of recursively finding all deps and sub-deps, only find top-level deps of the cwd