Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vajahath/npm-scope-prefixer
CLI tool to prefix scope on npm packages, helpful for deploying to multiple registries with different scope.
https://github.com/vajahath/npm-scope-prefixer
Last synced: about 12 hours ago
JSON representation
CLI tool to prefix scope on npm packages, helpful for deploying to multiple registries with different scope.
- Host: GitHub
- URL: https://github.com/vajahath/npm-scope-prefixer
- Owner: vajahath
- License: mit
- Created: 2019-11-23T20:18:00.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T01:34:47.000Z (about 2 years ago)
- Last Synced: 2024-04-10T18:09:49.456Z (9 months ago)
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/@vaju/npm-scope-prefixer
- Size: 637 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 25
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# npm-scope-prefixer
![](https://github.com/vajahath/npm-scope-prefixer/workflows/build-and-test/badge.svg) [![Greenkeeper badge](https://badges.greenkeeper.io/vajahath/npm-scope-prefixer.svg)](https://greenkeeper.io/)
CLI/API tool to prefix scope on npm packages, helpful for deploying to multiple npm registries with different scopes.
## Install
Requires Node >= 10.
From npm,
```sh
npm i -g @vaju/npm-scope-prefixer
```From [Github Package Registry](https://github.com/vajahath/npm-scope-prefixer/packages). ([Guide](https://help.github.com/en/github/managing-packages-with-github-packages/configuring-npm-for-use-with-github-packages)).
_(✔ Type definitions included for TypeScript)_
## CLI Usage
```sh
$ npm-scope-prefixer --helpUsage: npm-scope-prefixer [options]
Changes the package.json name property to new scope.
Options:
-V, --version output the version number
-s, --scope The new scope you want to use
-p, --pkg-path Absolute or relative path to package.json. If not provided, package.json in the
CWD is used.
-h, --help output usage information
```### Example
```
$ npm-scope-prefixer --scope @billy
## Package name re-scoped ('@xxx/my-pkg' > '@billy/my-pkg')
```The `@` in `--scope` is optional. If you skip it, this package internally adds `@`.
Also, you can optionally add path to the package.json. If not provided, package.json in the current working directory is used.
```
$ npm-scope-prefixer -s billy -p my/path/to/package.json
## Package name re-scoped ('@xxx/my-pkg' > '@billy/my-pkg')
```#### As an npm script
Install as dev dep.
```sh
npm i --save-dev @vaju/npm-scope-prefixer
```package.json
```json
{
"scripts": {
"rescope": "npm-scope-prefixer -s"
}
}
```machine/ci systems
```sh
npm run rescope @myorg
```## APIs
```js
import { scopePrefixer } from 'npm-scope-prefixer';
// or
const { scopePrefixer } = require('npm-scope-prefixer');// ...
await scopePrefixer(
'@scope', // required
'path/to/package.json' // optional
);
```## Licence
MIT © [Vajahath Ahmed](https://twitter.com/vajahath7)