diff --git a/Examples.md b/Examples.md index a360e76..9e486fe 100644 --- a/Examples.md +++ b/Examples.md @@ -1256,6 +1256,14 @@ https://gist.github.com/junegunn/15859538658e449b886f (for OS X) ### NPM [npm-fzf](https://github.com/hankchanocd/npm-fzf) - Fuzzy search npm modules with `fzf`. +``` +# run npm script (requires jq) +fns() { + local script + script=$(cat package.json | jq -r '.scripts | keys[] ' | sort | fzf) && npm run $(echo "$script") +} +``` + ### Locate `Alt-i` to paste item from `locate /` output (zsh only):