Skip to content

Commit 3fc7134

Browse files
authored
docs: update to reflect licensee as the implementation path
1 parent eb4bf24 commit 3fc7134

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

accepted/0028-npm-license.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,26 @@ Given that this is something that a non-trivial number of users care about _and_
1414

1515
## Detailed Explanation
1616

17+
### Dependency implementation:
18+
19+
- Add a dependency on [licensee](https://www.npmjs.com/package/licensee)
20+
- Follow the licensee API, with some modifications
21+
- CLI configuration and commands are aliased to `npm audit license <flags/arguments>` rather than the `licensee` command
22+
- JSON configuration can either exist in `package.json` under the `audit` property (as an object) in a `licenses` property (as an object), with the same API **or** under the `licenses` (as an object) property in a file named `audit.json`
23+
- one of the two should take precident over the other if duplication occurs. My preference would be package.json but I can understand why others would disagree and do not hold this opinion strongly.
24+
25+
### Additional commands and flags:
26+
27+
Since this proposal moves `npm audit` into a wholistic auditing suite rather than just focusing on security, there would need to be additional commands and flags to limit specific features of audit in addition to expanding the scope of the existing flags:
28+
29+
- `npm audit security` should be added for consistency. This would replicate the current `npm audit` behavior, auditing dependencies for known security vulnerabilities.
30+
- `npm audit` would now run both `npm audit security` and `npm audit license`
31+
- `--no-audit` now blocks `npm audit` which encompasses all audits
32+
- `--no-audit-security` should block **only security auditing**
33+
- `--no-audit-license` should block **only license auditing**
34+
35+
36+
<!-- Old "Detailed Explanation" - saved for context while drafting.
1737
- It should be possible to get a full report of the licenses from all dependencies.
1838
- This should be runnable from a single command: `npm audit licenses`
1939
- Offline (default)
@@ -44,6 +64,7 @@ Given that this is something that a non-trivial number of users care about _and_
4464
- This report should collect all licenses via the `license` properties from `package.json` files in `node_modules`, filtering out any licenses that are in `allow` and `block` in addition to any licenses or modules in `ignore`, and provide the user the option to `allow`, `block`, or `ignore` the license, one by one.
4565
- Online (`--online`)
4666
- This report should collect all licenses via the `license` properties from `package.json` files from a resolved dependency tree without needing the modules on disk, filtering out any licenses that are in `allow` and `block` in addition to any licenses or modules in `ignore`, and provide the user the option to `allow`, `block`, or `ignore` the license, one by one.
67+
-->
4768

4869
## Rationale and Alternatives
4970

@@ -52,7 +73,7 @@ There are a wide array of tools in the ecosystem that have been built to paper o
5273
Alternatives considered:
5374

5475
- Distinct command within the CLI, outside of audit (`npm license` or `npm compliance`).
55-
- Discarded this as it would potentially create further fragmentation where it's potentially unnecessary.
76+
- Discarded this as it would potentially create further fragmentation of the npm CLI's user-facing components where it's potentially unnecessary. Further, since this feature only _adds_ to `npm audit`, it should not detract from the experience of those already relying on `npm audit` for security functionality until they opt-in to using licensing functionality.
5677
- Leave it to the ecosystem.
5778
- This has been the state of the world for about a decade, and there's still been no excessively positive tooling that's come up and solved all the problems that exist in this space while achieving widespread adoption.
5879

@@ -74,7 +95,6 @@ Paid tooling:
7495
Open-source tooling:
7596

7697
- https://www.npmjs.com/package/license-checker - relatively widely used and similar-ish to what's proposed. Also a requirable module.
77-
- https://www.npmjs.com/package/licensee - similar-ish to what's proposed. Potentially already used by npm?
7898
- https://www.npmjs.com/package/license-report - similar-ish to what's proposed.
7999
- https://www.npmjs.com/package/nlf - similar-ish to what's proposed. Also a requirable module.
80100
- https://www.npmjs.com/package/npm-license - similar-ish to what's proposed.

0 commit comments

Comments
 (0)