This repository has been archived by the owner on May 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from sandacontiume/master
filter out declared optional dependencies which are not installed by npm, from the output
- Loading branch information
Showing
10 changed files
with
260 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,7 @@ | |
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# output files | ||
dependencies.js | ||
dependencies.js.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# CHANGELOG | ||
|
||
## 0.0.6 | ||
- Excluding from the input file those dependencies that are declared as optional, and no other mandatory dependency requires them. | ||
We did this because we noticed that dependencies that are declared as optional and are not required by any mandatory dependency, are simply not installed in the node_modules folder. | ||
|
||
## 0.0.5 | ||
- including graceful degradation when no dependencies | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
[![Build Status](https://travis-ci.com/philips-software/npm-dependencies-extractor.svg?branch=master)](https://travis-ci.com/philips-software/npm-dependencies-extractor) | ||
|
||
# npm-dependencies-extractor | ||
This is a CLI package that provides a command *extract-dependencies* to extract the flat list of (all) dependencies from a package-lock.json file (or another file with the same structure of your choice. If you want, instead of the package-lock.json, you may specify as input file the JSON file generated by the npm command to list json dependencies, such as: | ||
This is a CLI package that provides a command *extract-dependencies* to extract the flat list of (all installed) dependencies from a package-lock.json file (or another file with the same structure of your choice. If you want, instead of the package-lock.json, you may specify as input file the JSON file generated by the npm command to list json dependencies, such as: | ||
``` | ||
npm list --json > inputFile.json | ||
``` | ||
|
@@ -30,6 +30,13 @@ The second output format is a txt file containing an array of dependencies, one | |
[email protected] | ||
``` | ||
|
||
# Status | ||
0.0.6, see [CHANGELOG.md](./CHANGELOG.md) | ||
|
||
## Technology stack | ||
- Javascript | ||
- This software is intended to be used standalone, as a command-line tool | ||
|
||
## Prerequisites | ||
- you should have Node installed (this script was tested with node v8.12.0) | ||
|
||
|
@@ -78,6 +85,11 @@ extract-dependencies [options] | |
| --output [filename]| -o | Js filename to which the flat list of dependencies is written. If the file already exists, it will be overwritten. Default value: dependencies.js. One more representation of the flat dependencies is generated, in the form of text (as <output>.txt) | ||
| --verbose | | Verbose output of commands and errors | ||
|
||
### Sample usage | ||
|
||
``` | ||
npm run extract-dependencies -- -i ./test-data/input-with-optionals/package-lock-with-2-mandatory-dependencies.json --verbose | ||
``` | ||
|
||
## Usage scenarios | ||
|
||
|
@@ -111,3 +123,29 @@ extract-dependencies [options] | |
> | ||
> Currenlty supported values for encoding are: utf8, utf16le | ||
## Owners | ||
See [CODEOWNERS](./CODEOWNERS) | ||
|
||
## Maintainers | ||
See [MAINTAINERS.md](./MAINTAINERS.md) | ||
|
||
## Contributing | ||
See [CONTRIBUTING.md](./CONTRIBUTING.md) | ||
|
||
## License | ||
See [LICENSE.md](./LICENSE.md) | ||
|
||
## Author | ||
Sanda Contiu | ||
|
||
## Keywords | ||
- dependencies | ||
- npm | ||
- sbom | ||
- software bill of material | ||
- flat list | ||
- extract | ||
- retrieve | ||
- dependencies flat list | ||
- extract dependencies | ||
- list dependencies |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.