{"id":16293171,"url":"https://github.com/noriste/nprr","last_synced_at":"2025-04-09T10:46:54.553Z","repository":{"id":35160434,"uuid":"214450544","full_name":"NoriSte/nprr","owner":"NoriSte","description":"(deprecated) nprr: npm run + autocomplete 🚀","archived":false,"fork":false,"pushed_at":"2024-04-10T08:33:34.000Z","size":517,"stargazers_count":16,"open_issues_count":7,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-03T18:04:43.433Z","etag":null,"topics":["autocomplete","cli","npm-scripts"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/nprr","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NoriSte.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-11T13:59:14.000Z","updated_at":"2023-12-01T07:22:58.000Z","dependencies_parsed_at":"2024-10-24T20:15:39.589Z","dependency_job_id":"49c04321-4fb3-4b48-b181-6fc496d6c4fa","html_url":"https://github.com/NoriSte/nprr","commit_stats":{"total_commits":266,"total_committers":4,"mean_commits":66.5,"dds":0.4135338345864662,"last_synced_commit":"f3579c90774cf910de9a3f581e4dfe928cebf71c"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NoriSte%2Fnprr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NoriSte%2Fnprr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NoriSte%2Fnprr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NoriSte%2Fnprr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NoriSte","download_url":"https://codeload.github.com/NoriSte/nprr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248026919,"owners_count":21035585,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["autocomplete","cli","npm-scripts"],"created_at":"2024-10-10T20:10:25.107Z","updated_at":"2025-04-09T10:46:54.524Z","avatar_url":"https://github.com/NoriSte.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"(_Deprecated! Please check out https://fig.io/ or https://github.com/antfu/ni as possible alternatives_)\n\n---\n\n# nprr\n\nnprr: npm run + autocomplete 🚀\n\n\u003e TL;DR: install it with `$ npm i -g nprr`, run it with `$ nprr`. If you want, [add an alias](#shortcut).\n\n![npm](https://img.shields.io/npm/v/nprr) [![Build Status](https://travis-ci.com/NoriSte/nprr.svg?branch=master)](https://travis-ci.com/NoriSte/nprr) [![Coverage Status](https://coveralls.io/repos/github/NoriSte/nprr/badge.svg?branch=master)](https://coveralls.io/github/NoriSte/nprr?branch=feature/nprr) [![Mutation testing badge](https://badge.stryker-mutator.io/github.com/NoriSte/nprr/master)](https://stryker-mutator.github.io) [![Build Cron](https://img.shields.io/badge/build%20cron-weekly-44cc11.svg)](https://travis-ci.com/NoriSte/nprr)\n\u003cbr /\u003e[![Renovate enabled](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovatebot.com/) [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/) [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) [![Open Source Love](https://badges.frapsoft.com/os/mit/mit.svg?v=102)](https://github.com/ellerbrock/open-source-badge/) [![Known Vulnerabilities](https://snyk.io/test/github/noriste/nprr/badge.svg)](https://snyk.io/test/github/noriste/nprr)\n\n\u003c!-- $ docker run --rm -v $PWD:/data asciinema/asciicast2gif https://asciinema.org/a/274468.json demo.gif to generate a gif from the asciinema video --\u003e\n\n[![Nprr demo](assets/nprr-demo.gif)](https://github.com/NoriSte/nprr)\n_Watch the [video on asciinema](https://asciinema.org/a/274468)_\n\n## What is nprr?\n\n\u003cimg src=\"assets/nprr-logo.png\" alt=\"Nprr logo\" width=\"200\" /\u003e\n\nNprr is an `npm run` enhancer! It runs the good `npm run` programmatically (through `npm.run()`, not `child_process.exec()`) or let you choose the script to launch with autocomplete.\n\n## Features\n\n- runs a script the same way `npm run` would do\n- `$ nprr` reads the package.json scripts and let you choose the script to run with autocomplete\n- `$ nprr te` filters all the scripts containing `te` and lets you choose the script to run with autocomplete\n- `$ nprr test` runs directly any existing script (ex. `test`)\n\n## Examples\n\nImagine your package.json contains the following scripts:\n\n```json\n{\n  \"scripts\": {\n    \"test\": \"...\",\n    \"test:unit\": \"...\",\n    \"test:e2e\": \"...\",\n    \"build:production\": \"...\",\n    \"build:staging\": \"...\",\n    \"commit\": \"...\"\n  }\n}\n```\n\n- `$ nprr` presents an autocomplete with all the available scripts\n- `$ nprr te` presents an autocomplete with all the scripts containing \"te\" (\"test\", \"test:unit\", \"test:e2e\")\n- `$ nprr test` launches directly `npm run test`\n\n## Command options\n\nAll the scripts can be launched with options too, all the next examples chain `op1 op2` to the executed script, just after the autocomplete (or exact match) process:\n\n- `$ nprr -- op1 op2`\n- `$ nprr te -- op1 op2`\n- `$ nprr te op1 op2`\n- `$ nprr test -- op1 op2`\n- `$ nprr test op1 op2`\n\n## Installation\n\n`npm i -g nprr`\n\n## FAQ\n\n\u003cspan id=\"shortcut\"\u003e\u003c/span\u003e\n\n#### Could it be aliased to something shorter like \"npr\" or even \"r\"?\n\nYep! All the bin names are stored in `/usr/local/bin` and if you open it you can find the \"nprr\" symlink as long as the \"npm\" one (and \"npx\", etc.). All you need to do is duplicating it by running:\n\n`$ cp -a /usr/local/bin/nprr /usr/local/bin/YOUR_SHORTCUT` (replace \"YOUR_SHORTCUT\" with \"npr\", \"r\" or whatever you want)\n\nIf you change your mind and you want to remove the new shortcut, do not worry: remove it by running\n\n`$ rm /usr/local/bin/YOUR_SHORTCUT`\n\n#### How does it work?\n\nRead the dedicated article, both on [Medium](https://medium.com/@NoriSte/launching-npm-run-programmatically-with-npm-run-f2a1b8a569a6) or [dev.to](https://dev.to/noriste/launching-npm-run-programmatically-with-npm-run-3mmc).\n\n#### Could I use nprr programmatically?\n\nCertainly! The script below leverages nprr and gets the arguments passed to `nprr.run()` (please, do not forget to install nprr locally with `npm i -D nprr`)\n\n```js\nconst nprr = require(\"nprr\");\nnprr(\"test\").then(argv =\u003e {\n  console.log(argv);\n});\n```\n\nNprr accepts an array of strings or a string as the only argument.\n\n#### Is it possible to edit the filter passed to nprr?\n\nUnfortunately not but I'd love to add it as soon as possible. Nprr leverages [Enquirer](https://github.com/enquirer/enquirer) but, at the moment, it does not allow to do that, see the [related issue](https://github.com/enquirer/enquirer/issues/66) (and [Inquirer](https://github.com/SBoudrias/Inquirer.js/) can do that [neither](https://github.com/SBoudrias/Inquirer.js/issues/590)).\n\n#### Could npm allow for both autocomplete and fuzzy search?\n\nAt the moment the fuzzy search is not supported. I need to investigate how it could be done with Enquirer/Inquirer.\n\n### Why did you call it nprr?\n\nBecause \"npr\" has [already been used](https://www.npmjs.com/package/npr) on NPM.\n\n### Why did not you call it npra (npr + autocomplete)?\n\nBecause \"nprr\" is faser to be typed compared to \"npra\".\n\n#### Does a less-obtrusive solution exist to list the package.json scripts without opening it?\n\nYes, it's the built-in [npm-completion](https://docs.npmjs.com/cli/completion).\n\n#### How could I record a video of a terminal session like you did with the opening gif?\n\nUse [asciinema](https://asciinema.org/). If you want to generate a GIF, make the video public and convert it launching `$ docker run --rm -v $PWD:/data asciinema/asciicast2gif https://asciinema.org/a/VIDEOID.json video.gif`.\n\n### Notes\n\nThe E2E tests are run directly with Travis, take a look at the [`.travis.yml`](./.travis.yml) file.\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://twitter.com/NoriSte\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/173663?v=4\" width=\"100px;\" alt=\"Stefano Magni\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eStefano Magni\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/NoriSte/nprr/commits?author=NoriSte\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"#docs-NoriSte\" title=\"Docs\"\u003e📖\u003c/a\u003e \u003ca href=\"#content-NoriSte\" title=\"Content\"\u003e🖋\u003c/a\u003e \u003ca href=\"#example-NoriSte\" title=\"Examples\"\u003e💡\u003c/a\u003e \u003ca href=\"#ideas-NoriSte\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoriste%2Fnprr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnoriste%2Fnprr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoriste%2Fnprr/lists"}