Skip to content

Latest commit

 

History

History
32 lines (28 loc) · 1.16 KB

README.md

File metadata and controls

32 lines (28 loc) · 1.16 KB

npwut??

A quick way to return desired npm run methods to terminal.

Background

I built this for my own quality of life, I found it was helpful while working with many projects at once. I also wanted to work with Go on more simple CLI projects. Yes, I know you can easily run a few UNIX comamnds with a pipe to get the same result.

Steps

  • Read a folder
  • Create read buffer for package.json
  • Build structs based on commonly used phrases for npm run save to local variable
  • Decode package json file for any key names in 'scripts' object save to local variable
  • Parse given args for the npm command the user is looking for
  • Return the command to output
  • Scan specific directories (server/client)
  • If not found, return the entire list. User is able to hit a key to select desired command to paste to output.

How to build from source and run anywhere

$ git clone https://github.com/ncolletti/npwut
$ cd npwut
$ go build
$ mkdir ~/bin
$ mv npwut ~/bin
$ BASH: export PATH=$PATH:/home/<user>/bin
or
$ ZSH: path+=('/home/<user>/bin')
$ chmod u+x /home/<user>/bin/npwut

TODO

  • Environment preset (dev/prod)
  • Write tests