Extracts dependencies from the node_modules folder of a Javascript project, to a reference format. This reference format is a JSON file containing arrays of objects with keys name and version.
The node_modules folder is assumed to have been generated by one of the following commands: npm install
or yarn install
.
Outputs the following files:
- dependencies_from_node_modules.json (name can be overriden) contains the dependencies as identified in the node_modules folder, in a reference format. This reference format is a JSON file containing arrays of objects with keys name and version. It contains unique objects by the combination name and version
0.1.1, see CHANGELOG.md
- tested with the node_modules folder of various Javascript projects, as generated by the install command of the following package managers:
- yarn
- npm
In order to run this project, you should have installed:
- Node installed (we used node v12.2.0)
- yarn (we used version v1.19.0) The input to this script should be a folder named node_modules, as generated by the install commands of either npm or yarn .
Install globally:
npm install -g node-modules-dependencies-extractor
Or you could use it without installing by running:
npx node-modules-dependencies-extractor [options]
extract-nm-dependencies [options]
Flag | Alias | Functionality |
---|---|---|
--input [path] | -i | (mandatory) specifies path to the node_modules folder. |
--output [filename] | -o | (optional) Filename to which the list of dependencies (name+version) is written (json format). If the file already exists, it will be overwritten. Default value: dependencies_from_node_modules.json |
--verbose | Verbose output of commands and errors | |
--help | -h | Displays usage information |
--version | -v | Displays version number |
yarn extract-nm-dependencies -i ./test-data/node_modules_samples/siblings_no_nesting
- Javascript
- This software is intended to be used standalone, as a command-line tool
Get the sources locally; in a command line, go to the root folder of this project and execute:
yarn install
yarn test
or
yarn coverage
Automatically enabled: standard
yarn lint
See CODEOWNERS
See MAINTAINERS.md
See CONTRIBUTING.md
See LICENSE.md
Sanda Contiu
- dependencies
- sbom
- software bill of material
- node_modules
- npm
- yarn