A suite of Bash utilities for Node.js developers, NodeUtils make use of fuzzy-finding to enhance your Node.js development workflow.
Ensure these are installed and accessible from your shell.
You should also define an default-fuzzy-finder alias for your preferred fuzzy finder. Here's an example using fzf:
alias default-fuzzy-finder="fzf"- Copy the provided Bash functions from
nodeutilsinto your.bashrc,.bash_profile, or similar shell configuration file. - Restart your terminal or
sourcethe configuration file. - Navigate to any Node.js project directory and use the provided functions and aliases.
Invoke with:
node-fz [directory]- Provides a fuzzy-finding interface to select and run a
.jsfile from the specified directory. - Alias:
nfz
Invoke with:
npm-test-fz [directory]- Fuzzy-find and run a test file with
npm test. - Alias:
ntest-fz
Invoke with:
node-list-jest-tests [file-path]- Lists descriptions of tests (based on
it()blocks) from a Jest test file.
Invoke with:
npm-test-fz-it [directory]- Fuzzy-find a test file and then a specific test within it to run with
npm test. - Alias:
ntest-fz-it
Invoke with:
node-summarize-project- Provides a summary of the Node.js project, including the number of JavaScript files, the total lines of code, and details about installed packages.
- Alias:
nsummarize
Invoke with:
npm-run-fz- Fuzzy-finding interface to select and run a script from
package.json. - Alias:
nrun
- For most functions, you can provide a directory as an argument. If no directory is provided, the current directory is used.
- NodeUtils assumes the existence of a
package.jsonin the directory where the commands are run.
Your contributions are welcome! Feel free to extend nodeutils by adding new commands or tweaking the existing ones. Ensure you test any changes to maintain the integrity of the utility.