{"id":21396792,"url":"https://github.com/favware/npm-deprecate","last_synced_at":"2025-07-30T15:08:27.117Z","repository":{"id":37017689,"uuid":"399276515","full_name":"favware/npm-deprecate","owner":"favware","description":"Programmatically deprecate your NPM published packages matching specified criteria","archived":false,"fork":false,"pushed_at":"2024-05-19T05:30:56.000Z","size":11585,"stargazers_count":10,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-05-19T06:28:14.106Z","etag":null,"topics":["cleanup","cli","hacktoberfest","npm","packaging","utility"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/favware.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["favna"],"patreon":"favna","open_collective":null,"ko_fi":"favna","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":"https://donate.favware.tech/paypal"}},"created_at":"2021-08-23T23:37:51.000Z","updated_at":"2024-05-31T23:26:06.684Z","dependencies_parsed_at":"2023-10-16T21:52:34.078Z","dependency_job_id":"23b1c3d1-43d1-4856-af8f-6a2ce3ea4ffb","html_url":"https://github.com/favware/npm-deprecate","commit_stats":{"total_commits":192,"total_committers":4,"mean_commits":48.0,"dds":"0.22916666666666663","last_synced_commit":"1923b7ec6246b8f346ae82fcaa8fba3ff862a332"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/favware%2Fnpm-deprecate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/favware%2Fnpm-deprecate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/favware%2Fnpm-deprecate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/favware%2Fnpm-deprecate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/favware","download_url":"https://codeload.github.com/favware/npm-deprecate/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225911877,"owners_count":17544057,"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":["cleanup","cli","hacktoberfest","npm","packaging","utility"],"created_at":"2024-11-22T14:29:17.079Z","updated_at":"2024-11-22T14:29:17.740Z","avatar_url":"https://github.com/favware.png","language":"TypeScript","funding_links":["https://github.com/sponsors/favna","https://patreon.com/favna","https://ko-fi.com/favna","https://donate.favware.tech/paypal","https://github.com/sponsors/Favna"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# npm-deprecate\n\n**Programmatically deprecate your NPM published packages**\n\n[![GitHub](https://img.shields.io/github/license/favware/npm-deprecate)](https://github.com/favware/npm-deprecate/blob/main/LICENSE)\n[![npm](https://img.shields.io/npm/v/@favware/npm-deprecate?color=crimson\u0026logo=npm)](https://www.npmjs.com/package/@favware/npm-deprecate)\n\n[![Support Server](https://discord.com/api/guilds/512303595966824458/embed.png?style=banner2)](https://join.favware.tech)\n\n\u003c/div\u003e\n\n## Description\n\nWhen working on larger libraries it may be desirable to release every commit to\nNPM automatically using a GitHub workflow. However when doing this you'll end up\nwith a LOT of versions on npm, which gets extremely cluttered.\n\nTo solve this, one can use this package to programmatically deprecate many\nversions at once, matching a glob that is checked against the version name.\n\n## Installation\n\nYou can use the following command to install this package, or replace\n`npm install -D` with your package manager of choice.\n\n```sh\nnpm install -D @favware/npm-deprecate\n```\n\nOr install it globally:\n\n```sh\nnpm install -g @favware/npm-deprecate\n```\n\nThen call the script with `npm-deprecate` or `nd`:\n\n```sh\nnpm-deprecate --name \"*next*\" --package \"@favware/npm-deprecate\" # Add any other flags or use --help\nnd --name \"*next*\" --package \"@favware/npm-deprecate\" # Add any other flags or use --help\n```\n\nAlternatively you can call the CLI directly with `npx`:\n\n```sh\nnpx @favware/npm-deprecate --name \"*next*\" --package \"@favware/npm-deprecate\" # Add any other flags or use --help\n```\n\n## Usage\n\n### Environment Variables\n\nThe following environment variables have to be set before running this script:\n\n| Name              | Required | Description                                                     |\n| ----------------- | -------- | --------------------------------------------------------------- |\n| `NODE_AUTH_TOKEN` | Yes      | The NPM Automation Token that can be used to deprecate versions |\n\n### Configuration\n\nYou can provide all options through CLI flags:\n\n```sh\nUsage: npm-deprecate [options]\n\nOptions:\n  -V, --version                                output the version number\n  -n, --name \u003cnameGlob\u003e                        A glob pattern that will determine which packages are deprecated. Anything that passes\n                                               [Micromatch](https://www.npmjs.com/package/micromatch) will work here. For example set `*dev*` to match `13.2.0-dev.123a`.\n  -d, --deprecate-dist-tag [deprecateDistTag]  Whether the version that is in the current dist tags should be preserved or not. By default dist tags are preserved. When set\n                                               to `true`, dist tags are pruned. (default: false)\n  -m, --message [message]                      A custom message to show for all the deprecated versions. (default: \"This version has been automatically deprecated by\n                                               @favware/npm-deprecate. Please use a newer version.\")\n  -v, --verbose                                Print verbose information (default: false)\n  -p, --package \u003cpackages...\u003e                  Repeatable, each will be treated as another package. The packages that should be deprecated\n  -h, --help                                   display help for command\n```\n\nOr, you can set most of these options through a configuration file. This file\nshould be located at your current working directory (where you're calling this\npackage). It should be named `.npm-deprecaterc`, optionally suffixed with\n`.json`, `.yaml`, or `.yml`.\n\n### Config file fields\n\n- `--name` maps to `name`\n- `--deprecate-dist-tag` maps to `deprecateDistTag`\n- `--verbose` maps to `verbose`\n- `--message` maps to `message`\n- `--package` maps to `package`\n\nWhen using `.npm-deprecaterc` or `.npm-deprecaterc.json` as your config file you\ncan also use the JSON schema to get schema validation. To do so, add the\nfollowing to your config file:\n\n```json\n{\n  \"$schema\": \"https://raw.githubusercontent.com/favware/npm-deprecate/main/assets/npm-deprecate.schema.json\"\n}\n```\n\n**Example JSON file**:\n\n```json\n{\n  \"$schema\": \"https://raw.githubusercontent.com/favware/npm-deprecate/main/assets/npm-deprecate.schema.json\",\n  \"name\": \"*next*\",\n  \"deprecateDistTag\": false,\n  \"verbose\": true,\n  \"package\": [\"@favware/cliff-jumper\", \"@favware/npm-deprecate\"]\n}\n```\n\n**Example YAML file**:\n\n```yaml\nname: '*next*'\ndeprecateDistTag: false\nverbose: true\npackage:\n  - '@favware/cliff-jumper'\n  - '@favware/npm-deprecate'\n```\n\n### Default values\n\nThis library has opinionated defaults for its options. These are as follows:\n\n- `--deprecate-dist-tag` will default to `false`.\n- `--message` will default to\n  `This version has been automatically deprecated by @favware/npm-deprecate. Please use a newer version.`.\n- `--verbose` will default to `false`.\n\n### Using this in a GitHub Workflow\n\n```yaml\nname: NPM Auto Deprecate\n\non:\n  schedule:\n    - cron: '0 0 * * *'\n\njobs:\n  auto-deprecate:\n    name: NPM Auto Deprecate\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout Project\n        uses: actions/checkout@v2\n      - name: Use Node.js v18\n        uses: actions/setup-node@v2\n        with:\n          node-version: 18\n          cache: yarn\n          registry-url: https://registry.npmjs.org/\n      - name: Install Dependencies if Cache Miss\n        run: yarn --immutable\n      - name: Deprecate versions\n        run: yarn npm-deprecate\n        env:\n          NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}\n```\n\n## Buy us some doughnuts\n\nFavware projects are and always will be open source, even if we don't get\ndonations. That being said, we know there are amazing people who may still want\nto donate just to show their appreciation. Thank you very much in advance!\n\nWe accept donations through Ko-fi, Paypal, Patreon, GitHub Sponsorships, and\nvarious cryptocurrencies. You can use the buttons below to donate through your\nmethod of choice.\n\n|   Donate With   |                      Address                      |\n| :-------------: | :-----------------------------------------------: |\n|      Ko-fi      |  [Click Here](https://donate.favware.tech/kofi)   |\n|     Patreon     | [Click Here](https://donate.favware.tech/patreon) |\n|     PayPal      | [Click Here](https://donate.favware.tech/paypal)  |\n| GitHub Sponsors |  [Click Here](https://github.com/sponsors/Favna)  |\n|     Bitcoin     |       `1E643TNif2MTh75rugepmXuq35Tck4TnE5`        |\n|    Ethereum     |   `0xF653F666903cd8739030D2721bF01095896F5D6E`    |\n|    LiteCoin     |       `LZHvBkaJqKJRa8N7Dyu41Jd1PDBAofCik6`        |\n\n## Contributors\n\nPlease make sure to read the [Contributing Guide][contributing] before making a\npull request.\n\nThank you to all the people who already contributed!\n\n\u003ca href=\"https://github.com/favware/npm-deprecate/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=favware/npm-deprecate\" /\u003e\n\u003c/a\u003e\n\n[contributing]: .github/CONTRIBUTING.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffavware%2Fnpm-deprecate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffavware%2Fnpm-deprecate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffavware%2Fnpm-deprecate/lists"}