xargv
v0.0.7
Published
Node package runner with ability to pass foreign args
Downloads
1
Readme
Xargv
Node package runner with ability to pass foreign args.
Main features
- run any node cli tool with additional args
- passes unknown args as env variable to the e.g. underlying config scripts
- Typescript types included
- exposes esm/cjs modules
- always 100% test coverage
Guide
Installation
or
or
Basic usage
Imagine a situation: you want to dynamically generate webpack config (webpack.config.js) based on provided args but webpack cli blocks you from passing any foreign values.
Below you will find way to deal with it.
Set argv config in the config file
In the root of the project provide .xargvrc file:
Keep in mind you can define same config in the package.json file:
As soon as you have config defined use it in one of the npm script's:
Or via cli if you have installed package globally:
For working examples please take a look at the repos example dir.
Documentation
Full API documentation for this package can be found here