2.0.1 • Published 3 years ago
@sushidesu/trun v2.0.1
@sushidesu/trun
npm run with template string.
Installation
yarn add -D @sushidesu/trun
# OR
npm install --save-dev @sushidesu/trun
Usage
trun [command] [arg1] [arg2]...
prop | description |
---|---|
[command] | command to run. If you include {} , it will be replaced by args . |
[args] | string to replace {} with. |
TRUN replaces {}
with args
and executes command.
Example
❯ yarn trun "echo {} and {}" hello world!
yarn run v1.22.15
$ /home/.../node_modules/.bin/trun 'echo {} and {}' hello world!
[trun] echo hello and world!
hello and world!
Done in 0.12s.
Recommended Usage
You can add this to scripts
in package.json.
Example
{
"scripts": {
"testit": "trun jest \"--testPathPattern={}\"",
}
}
Then, you can flexibly execute npm scripts with a small number of types.
$ yarn testit some-file
# then execute --->
$ yarn jest --testPathPattern=some-file