{"id":15503835,"url":"https://github.com/kentcdodds/nps-utils","last_synced_at":"2025-04-06T01:08:40.443Z","repository":{"id":46761814,"uuid":"83648955","full_name":"kentcdodds/nps-utils","owner":"kentcdodds","description":"Utilities for http://npm.im/nps (npm-package-scripts)","archived":false,"fork":false,"pushed_at":"2022-09-16T11:36:01.000Z","size":3370,"stargazers_count":102,"open_issues_count":21,"forks_count":23,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-30T00:06:58.314Z","etag":null,"topics":["command-line","javascript","package-scripts","scripts","utilities"],"latest_commit_sha":null,"homepage":"https://doclets.io/kentcdodds/nps-utils/master","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kentcdodds.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-02T07:37:14.000Z","updated_at":"2025-02-23T18:09:12.000Z","dependencies_parsed_at":"2022-09-24T15:42:36.700Z","dependency_job_id":null,"html_url":"https://github.com/kentcdodds/nps-utils","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kentcdodds%2Fnps-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kentcdodds%2Fnps-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kentcdodds%2Fnps-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kentcdodds%2Fnps-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kentcdodds","download_url":"https://codeload.github.com/kentcdodds/nps-utils/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247419860,"owners_count":20936012,"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":["command-line","javascript","package-scripts","scripts","utilities"],"created_at":"2024-10-02T09:14:50.847Z","updated_at":"2025-04-06T01:08:40.422Z","avatar_url":"https://github.com/kentcdodds.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nps-utils\n\nUtilities for [nps][nps] (npm-package-scripts)\n\n[![Build Status][build-badge]][build]\n[![Code Coverage][coverage-badge]][coverage]\n[![Dependencies][dependencyci-badge]][dependencyci]\n[![version][version-badge]][package]\n[![downloads][downloads-badge]][npm-stat]\n[![MIT License][license-badge]][LICENSE]\n\n[![All Contributors](https://img.shields.io/badge/all_contributors-4-orange.svg?style=flat-square)](#contributors)\n[![PRs Welcome][prs-badge]][prs]\n[![Donate][donate-badge]][donate]\n[![Code of Conduct][coc-badge]][coc]\n[![Roadmap][roadmap-badge]][roadmap]\n[![Examples][examples-badge]][examples]\n\n[![Watch on GitHub][github-watch-badge]][github-watch]\n[![Star on GitHub][github-star-badge]][github-star]\n[![Tweet][twitter-badge]][twitter]\n\n\u003ca href=\"https://app.codesponsor.io/link/PKGFLnhDiFvsUA5P4kAXfiPs/kentcdodds/nps-utils\" rel=\"nofollow\"\u003e\u003cimg src=\"https://app.codesponsor.io/embed/PKGFLnhDiFvsUA5P4kAXfiPs/kentcdodds/nps-utils.svg\" style=\"width: 888px; height: 68px;\" alt=\"Sponsor\" /\u003e\u003c/a\u003e\n\n## The problem\n\n[nps][nps] is a great package to empower your scripts and there are some common\nthings you wind up doing to keep your `package-scripts.js` file clean, useful,\nand maintainable. So you wind up duplicating utility functions across projects.\n\n## This solution\n\nThis has several utility functions you'll often want when using `nps`.\n\nCheck out what the `concurrent` and `runInNewWindow` methods can do:\n\n\u003ca href=\"https://github.com/kentcdodds/nps-utils/raw/master/other/nps-utils-demo.gif\" title=\"Pull out npm scripts into another file with nps\"\u003e\n  \u003cimg src=\"https://github.com/kentcdodds/nps-utils/raw/master/other/nps-utils-demo.gif\" alt=\"concurrent gif\" title=\"concurrent gif\" width=\"700\" /\u003e\n\u003c/a\u003e\n\n## Installation\n\nThis module is distributed via [npm][npm] which is bundled with [node][node] and\nshould be installed as one of your project's `devDependencies`:\n\n```\nnpm install --save-dev nps-utils\n```\n\n## Usage\n\nYou'll most likely use this in your `package-scripts.js` file:\n\n```javascript\nconst npsUtils = require('nps-utils')\n\nmodule.exports = {\n  scripts: {\n    validate: npsUtils.concurrent.nps('lint', 'build', 'test --coverage'),\n    lint: 'eslint .',\n    build: 'webpack --env.production',\n    test: 'jest'\n  }\n}\n```\n\n### Available methods:\n\nAPI docs can be found [here](https://doc.esdoc.org/github.com/kentcdodds/nps-utils/)\n\n- [concurrent](https://doc.esdoc.org/github.com/kentcdodds/nps-utils/function/index.html#static-function-concurrent)\n- [series](https://doc.esdoc.org/github.com/kentcdodds/nps-utils/function/index.html#static-function-series)\n- [runInNewWindow](https://doc.esdoc.org/github.com/kentcdodds/nps-utils/function/index.html#static-function-runInNewWindow)\n- [rimraf](https://doc.esdoc.org/github.com/kentcdodds/nps-utils/function/index.html#static-function-rimraf)\n- [ifWindows](https://doc.esdoc.org/github.com/kentcdodds/nps-utils/function/index.html#static-function-ifWindows)\n- [ifNotWindows](https://doc.esdoc.org/github.com/kentcdodds/nps-utils/function/index.html#static-function-ifNotWindows)\n- [copy](https://doc.esdoc.org/github.com/kentcdodds/nps-utils/function/index.html#static-function-copy)\n- [ncp](https://doc.esdoc.org/github.com/kentcdodds/nps-utils/function/index.html#static-function-ncp)\n- [mkdirp](https://doc.esdoc.org/github.com/kentcdodds/nps-utils/function/index.html#static-function-mkdirp)\n- [open](https://doc.esdoc.org/github.com/kentcdodds/nps-utils/function/index.html#static-function-open)\n- [crossEnv](https://doc.esdoc.org/github.com/kentcdodds/nps-utils/function/index.html#static-function-crossEnv)\n- [includePackage](https://doc.esdoc.org/github.com/kentcdodds/nps-utils/function/index.html#static-function-includePackage)\n\n`nps` also exports [`common-tags`][common-tags] as `commonTags` which can be\nreally helpful for long scripts or descriptions.\n\nOr, see the JSDoc right in\n[the source code](https://github.com/kentcdodds/nps-utils/blob/master/src/index.js) 😎\n\n## Inspiration\n\nThis package was inspired by the removal of `--parallel` from `p-s`\n[here](https://github.com/kentcdodds/p-s/pull/94).\n\n## Other Solutions\n\nI am unaware of other solutions, but if you come across any, please add a PR to\nlist them here!\n\n## Contributors\n\nThanks goes to these people ([emoji key][emojis]):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n| [\u003cimg src=\"https://avatars.githubusercontent.com/u/1500684?v=3\" width=\"100px;\"/\u003e\u003cbr /\u003e\u003csub\u003eKent C. Dodds\u003c/sub\u003e](https://kentcdodds.com)\u003cbr /\u003e[💻](https://github.com/kentcdodds/nps-utils/commits?author=kentcdodds) [📖](https://github.com/kentcdodds/nps-utils/commits?author=kentcdodds) 🚇 [⚠️](https://github.com/kentcdodds/nps-utils/commits?author=kentcdodds) | [\u003cimg src=\"https://avatars2.githubusercontent.com/u/7352279?v=3\" width=\"100px;\"/\u003e\u003cbr /\u003e\u003csub\u003eHuy Nguyen\u003c/sub\u003e](https://www.huy-nguyen.com/)\u003cbr /\u003e[📖](https://github.com/kentcdodds/nps-utils/commits?author=huy-nguyen) 🚇 | [\u003cimg src=\"https://avatars1.githubusercontent.com/u/1970063?v=4\" width=\"100px;\"/\u003e\u003cbr /\u003e\u003csub\u003eKeith Gunn\u003c/sub\u003e](https://github.com/gunnx)\u003cbr /\u003e[🐛](https://github.com/kentcdodds/nps-utils/issues?q=author%3Agunnx) [💻](https://github.com/kentcdodds/nps-utils/commits?author=gunnx) [📖](https://github.com/kentcdodds/nps-utils/commits?author=gunnx) [⚠️](https://github.com/kentcdodds/nps-utils/commits?author=gunnx) | [\u003cimg src=\"https://avatars3.githubusercontent.com/u/215033?v=4\" width=\"100px;\"/\u003e\u003cbr /\u003e\u003csub\u003eMike Cann\u003c/sub\u003e](http://www.mikecann.co.uk)\u003cbr /\u003e[💻](https://github.com/kentcdodds/nps-utils/commits?author=mikecann) [⚠️](https://github.com/kentcdodds/nps-utils/commits?author=mikecann) |\n| :---: | :---: | :---: | :---: |\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors][all-contributors] specification. Contributions of any kind welcome!\n\n## LICENSE\n\nMIT\n\n[npm]: https://www.npmjs.com/\n[node]: https://nodejs.org\n[build-badge]: https://img.shields.io/travis/kentcdodds/nps-utils.svg?style=flat-square\n[build]: https://travis-ci.org/kentcdodds/nps-utils\n[coverage-badge]: https://img.shields.io/codecov/c/github/kentcdodds/nps-utils.svg?style=flat-square\n[coverage]: https://codecov.io/github/kentcdodds/nps-utils\n[dependencyci-badge]: https://dependencyci.com/github/kentcdodds/nps-utils/badge?style=flat-square\n[dependencyci]: https://dependencyci.com/github/kentcdodds/nps-utils\n[version-badge]: https://img.shields.io/npm/v/nps-utils.svg?style=flat-square\n[package]: https://www.npmjs.com/package/nps-utils\n[downloads-badge]: https://img.shields.io/npm/dm/nps-utils.svg?style=flat-square\n[npm-stat]: http://npm-stat.com/charts.html?package=nps-utils\u0026from=2016-04-01\n[license-badge]: https://img.shields.io/npm/l/nps-utils.svg?style=flat-square\n[license]: https://github.com/kentcdodds/nps-utils/blob/master/other/LICENSE\n[prs-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square\n[prs]: http://makeapullrequest.com\n[donate-badge]: https://img.shields.io/badge/$-support-green.svg?style=flat-square\n[donate]: http://kcd.im/donate\n[coc-badge]: https://img.shields.io/badge/code%20of-conduct-ff69b4.svg?style=flat-square\n[coc]: https://github.com/kentcdodds/nps-utils/blob/master/other/CODE_OF_CONDUCT.md\n[roadmap-badge]: https://img.shields.io/badge/%F0%9F%93%94-roadmap-CD9523.svg?style=flat-square\n[roadmap]: https://github.com/kentcdodds/nps-utils/blob/master/other/ROADMAP.md\n[examples-badge]: https://img.shields.io/badge/%F0%9F%92%A1-examples-8C8E93.svg?style=flat-square\n[examples]: https://github.com/kentcdodds/nps-utils/blob/master/other/EXAMPLES.md\n[github-watch-badge]: https://img.shields.io/github/watchers/kentcdodds/nps-utils.svg?style=social\n[github-watch]: https://github.com/kentcdodds/nps-utils/watchers\n[github-star-badge]: https://img.shields.io/github/stars/kentcdodds/nps-utils.svg?style=social\n[github-star]: https://github.com/kentcdodds/nps-utils/stargazers\n[twitter]: https://twitter.com/intent/tweet?text=Check%20out%20nps-utils!%20https://github.com/kentcdodds/nps-utils%20%F0%9F%91%8D\n[twitter-badge]: https://img.shields.io/twitter/url/https/github.com/kentcdodds/nps-utils.svg?style=social\n[emojis]: https://github.com/kentcdodds/all-contributors#emoji-key\n[all-contributors]: https://github.com/kentcdodds/all-contributors\n[nps]: https://npmjs.com/package/nps\n[doclet]: https://doclets.io/kentcdodds/nps-utils/master\n[common-tags]: https://npmjs.com/package/common-tags\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkentcdodds%2Fnps-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkentcdodds%2Fnps-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkentcdodds%2Fnps-utils/lists"}