Skip to content

Commit

Permalink
docs: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob-shuman committed May 11, 2022
1 parent 132432b commit e892b6b
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,37 @@
▐█▄█▌ ██▐█▌ ▐█▄▪▐█ ▐███▌ ▐█•█▌ ▐█▌ ▐█▪·• ▐█▌·
▀▀▀ ▀▀ █▪ ▀▀▀▀ ·▀▀▀ .▀ ▀ ▀▀▀ .▀ ▀▀▀
```

_**Run npm scripts using shorthands**_

Unscript lets you run npm scripts using shorthands generated from the names of scripts in your `package.json`. Unscript creates shorthands by combining the first letter of each word separated by a delimiter (`:` by default).

For example:

- `dev` would be shortened to `d`.
- `build:dev` would be shortened to `bd`.
- `lint:watch` would be shortened to `lw`.

## Options

| option | default | description |
| ------------------- | ------- | --------------------------------------------- |
| `-p`, `--path` | `"."` | Path to folder containing package.json. |
| `-d`, `--delimiter` | `":"` | Character to separate words by. |
| `-a`, `--auto` | `false` | Run the selected script without confirmation. |
| `-s`, `--scripts` | `false` | Display scripts in found package.json. |

## Usage

Unscript can be run using npx:

```bash
npx unscript lw
```

to save time writing that out it is recommended to alias the command to a shorter name:

```bash
# .bashrc .zshrc ...etc
alias un='npx unscript'
```
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ import prompts from "prompts";
program
.version(packageJson.version, "-v, --version")
.description(packageJson.description)
.addArgument(new Argument("shorthand"))
.addArgument(new Argument("query"))
.option("-p, --path <path>", "Path to folder containing package.json.", ".")
.option("-d, --delimiter <delim>", "Character to separate words by.", ":")
.option("-a, --auto", "Run the selected script without confirmation.", false)
.option("-s, --scripts", "Display scripts in found package.json", false)
.option("-s, --scripts", "Display scripts in found package.json.", false)
.action(
async (
query: string,
Expand Down

0 comments on commit e892b6b

Please sign in to comment.