-
-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
Hi team,
First off, great work on this library—it’s been really helpful!
I’d like to suggest a new feature: Enable clients to create the .nsprc
object dynamically via JavaScript. This could be especially useful for those who want to generate the object by consuming external APIs.
Proposed Feature Outline
- Config file setup: Clients would add a
config.{js,ts}
file to their project. - Exported method: This file exports an object with a method named
requestNsprcFile
. - Method functionality: The
requestNsprcFile
method generates and returns an object with the same structure as the.nsprc
file. - Library behavior:
- The library will call
requestNsprcFile
when:- The
--config
or-c
option is passed to theaudit
command (e.g.,better-npm-audit audit -c configFile.js
). requestNsprcFile
is defined in the config file.- If neither condition is met, the
.nsprc
file will be used as usual.
- The
- The library will call
- Future extensions: This config file can potentially support additional features.
I took the liberty of forking the project to work on this (WIP).
A quick demo:
demo-audit.mp4
What do you think—is this a good approach? Any suggestions or feedback on the feature design?
Thank you!
Metadata
Metadata
Assignees
Labels
No labels