https://github.com/mohammedyh/npr
A CLI tool that lets you browse and run npm, pnpm, yarn, or bun scripts from a local project.
https://github.com/mohammedyh/npr
cli cli-tool go golang npm-scripts npm-scripts-runner
Last synced: 4 months ago
JSON representation
A CLI tool that lets you browse and run npm, pnpm, yarn, or bun scripts from a local project.
- Host: GitHub
- URL: https://github.com/mohammedyh/npr
- Owner: mohammedyh
- Created: 2024-06-02T11:54:13.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-29T13:19:14.000Z (7 months ago)
- Last Synced: 2024-12-29T23:56:31.801Z (6 months ago)
- Topics: cli, cli-tool, go, golang, npm-scripts, npm-scripts-runner
- Language: Go
- Homepage:
- Size: 177 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# npr - npm script runner
A CLI tool that lets you browse and execute npm, pnpm, yarn, or bun scripts from a local project.

## Installation
To install the compiled version of the package run:
```sh
go install github.com/mohammedyh/npr@latest
```> [!IMPORTANT]
> `go/bin` needs to be in your PATH to be able to run the command.
>
> Add the following to your shell config file: `export PATH="$PATH:$HOME/go/bin"`Once installed, simply run `npr`
### Build From Source
Clone the repo:
```sh
git clone https://github.com/mohammedyh/npr
````cd` into the directory
```sh
cd ~/Dev/npr
```Build and output executable
```sh
go build
```After compiling into an executable, you could move the executable file to somewhere suitable in your filesystem and create an alias in your shell to reference it.
For example - if you moved the executable to the `.config` folder:
```sh
alias npr="~/.config/npr"
```## Features
- Display scripts in an interactive list which can be navigated through using vim motions or arrow keys
- Auto-detect package manager from npm, pnpm, yarn and bun
- Scripts are sorted in alphabetical order
- Auto-install dependencies if package.json is found but `node_modules` isn't## Todo
- [ ] Look at how to properly structure a Go program