bahmutov / npm-quick-run Goto Github PK
View Code? Open in Web Editor NEWQuickly run NPM script by prefix without typing the full name
Quickly run NPM script by prefix without typing the full name
To execute if the check fails after showing the help message
Currently does not show error output from npm that has npm ERR!
lines, but because it gets an chunk of the output with npm
first, it prints it before getting the complete npm ERR!
Need to find a stream module that buffers output into lines
Currently throws an exception
$ nr
[email protected]
- Quickly run NPM script by prefix without typing the full name
USE: nrun <npm script prefix> <script arguments>
"nr t" === "nrun t" === "npm test"
"nr m -w" probably will find "npm run mocha -- --w"
module.js:339
throw err;
^
Error: Cannot find module '/git/package.json'
Prefix is good but not when you have long command, command:fix, command:beta, command:dev
then it fails.
So I wish to add fuzzy search; many JS library already implement it.
nr example "Line Test"
Is being converted to
npm "run" "example" "--" "Line" "Test"
Hi, @bahmutov, thanks for you amazing work!
I frequently use scripts like "watch:test": "npm run test -- --watch"
, that contain :
in the name.
So the idea to support nr w:t
What do you think? I guess it can be done as an extension of json-package, isn't it?
I'd love to just remove this
If I get it wrong, I can just try things over again ๐คทโโ๏ธ
When there are multiple matching scripts (or showing all of them), make sure to sort them
To replace Travis CI
Sometimes there is exact match and there are other prefixes. For example
"test": "...",
"test-foo": "..."
nr test
should run "test" script
behind '--'
need to spawn npm run shell and pass arguments behind --
Probably use execa-wrap
Right now when printing all scripts pints just names. Maybe if printing on separate lines should print the script command text too?
To avoid using global scripts completely.
For example, imagine we install pm2 as a local dev dependency
npm i -D pm2
// how to run pm2?
node node_modules/.bin/pm2
// could be much better to run
nr pm2
Seems pre-git wizard is not working when running via nr c
command
Seems if the nr lint
command fails, it prints the NPM error twice, which is a LOT of output.
Use condition-node-version plugin
If there are many labels, like more than 3, print them on separate lines
For example if script are command, command:dev
we cannot run command
without full name.
It would be nice to add .
to mean "no more words" and be able to run nr c.
Currently prints help, should also print all available script labels
using spots repo as example
Available scripts are , browser, test
$ nr --help
/usr/bin/env: node --harmony: No such file or directory
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.