https://github.com/crutchcorn/plop-pack-azure-npm
A plop helper that provides a setup for Azure NPM NPMRC files
https://github.com/crutchcorn/plop-pack-azure-npm
Last synced: 3 months ago
JSON representation
A plop helper that provides a setup for Azure NPM NPMRC files
- Host: GitHub
- URL: https://github.com/crutchcorn/plop-pack-azure-npm
- Owner: crutchcorn
- Created: 2020-05-21T20:32:03.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-03-26T19:35:47.000Z (about 3 years ago)
- Last Synced: 2025-02-02T04:25:32.569Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 167 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Plop Pack Azure NPM
[](https://www.npmjs.com/package/plop-pack-azure-npm)
Useful to have action for [PlopJS](https://github.com/plopjs/plop). This action helps users [setup their Azure DevOps NPMRC file](https://docs.microsoft.com/en-us/azure/devops/artifacts/get-started-npm?view=azure-devops&tabs=windows#set-up-your-npmrc-files)
## Installation
```
npm i plop-pack-azure-npm
```## Config
```javascript
{
projectName: 'PROJ_NAME',
registryUrl: 'pkgs.dev.azure.com/PROJ_NAME/project-uuid-999-999/_packaging/package-name/npm'
}
```Your `registryUrl` must not contain a tailing `/` nor the `registry/` postfix or `https://` prefix
There's also an optional property you can pass to config: `progressSpinner`. It's required to use this property when using `plop` instead of `node-plop`,
as otherwise the spinner will cause problems with the input.```javascript
const {progressSpinner} = require('plop');const azureConfig = {
projectName: '',
registryUrl: '',
progressSpinner
}```
## Example
```javascript
module.exports = function(plop) {
// Loads the npmInstall action type
plop.load('plop-pack-azure-npm');plop.setGenerator('generate', {
prompts: [
// ...
],
actions: function(data) {
const actions = [];actions.push({
type: 'npmInstall',
path: `${process.cwd()}/project-name/`,
// By default is false, but if "true" will log the output of commands
verbose: true
})
}
})
}
```