Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oresoftware/gmx
🔶 gmx 🔶 Gimmicks for the win. Similar to "npx". 🔶
https://github.com/oresoftware/gmx
developer-experience dx local-development nodejs npm npx
Last synced: 8 days ago
JSON representation
🔶 gmx 🔶 Gimmicks for the win. Similar to "npx". 🔶
- Host: GitHub
- URL: https://github.com/oresoftware/gmx
- Owner: ORESoftware
- License: mit
- Created: 2018-05-02T19:19:03.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-05-08T03:15:13.000Z (almost 5 years ago)
- Last Synced: 2024-10-07T07:43:23.245Z (5 months ago)
- Topics: developer-experience, dx, local-development, nodejs, npm, npx
- Language: Shell
- Homepage:
- Size: 573 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# GMX - running local NPM executables by default
Pronounced "gimmicks".
This tool is similar to the official NPM tool "npx", but "gmx" attempts to do less, but do less better.---------
If local executables exist in `./node_modules/.bin`, gmx will use those first.
For example, if you have a local and global version of nodemon, `gmx -- nodemon`, will use the local version
if you are within the project, otherwise if your cwd is outside the project, will use the global version of nodemon.
Just depends on your cwd.---------
## Installation:
```bash
npm install -g gmx
```## Usage
```bash
$ gmx echo 'foobar'
```### Something more useful/realistc
You may want to run a local version of typescript/tsc or nodemon, so you would do:
```bash
$ gmx -- tsc -w
```or:
```bash
$ gmx -- nodemon
```### To define an executable string, use:
```bash
$ gmx --exec='tsc -w'
```or for short:
```bash
$ gmx -e 'tsc -w'
```## Running jobs in parallel
Bash does a fine job of running things in series, so we don't need to help bash with that,
but if you want to run commands in parallel, use gmx:```bash
$ gmx -e 'echo "foo"' -e 'exit 3' -e 'echo "baz"'
```the above will exit with code 1, as evidence by the output from:
```bash
$ gmx -e 'echo "foo"' -e 'exit 3' -e 'echo "baz"'; echo $?
```if we run the above, we get:
> foo
> baz
> 1to exit the `gmx` process with 0 if any subcommand exits with 0, use the `--any` option:
```bash
$ gmx --any -e 'echo "foo"' -e 'exit 3' -e 'echo "baz"'; echo $?
```now we get:
> foo
> baz
> 0