1.0.5 • Published 9 months ago

devops-npmrc v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

DevOps .npmrc CLI

npm version npm version

CLI tool for adding Azure DevOps artifact feed to .npmrc on unix based systems like macOS or Linux.

Works for both npm and yarn.

Prerequisites

To use the tool you will need:

  • DevOps organization name
  • DevOps artifact feed name
  • A personal access token (global file only)
  1. Find the name of your organization and feed

    • Go to https://dev.azure.com/ and log in to your organization.
    • Select the project where your feed is located and navigate to Artifacts in the menu to the left.
    • Select the feed you wish to add to .npmrc from the dropdown menu in the top left corner.
    • Retrieve organization and feed from the url: dev.azure.com/<organization>/Your.Project/_artifacts/<feed>
  2. Generate a personal access token

Quick start

Before using the tool make sure you have all the prerequisites.

Add a registry to the global .npmrc file

npx devops-npmrc@latest

To be able to install packages you also need to add a .npmrc file to your project

# cd to your project
cd /path/to/your/project

# Then run
npx devops-npmrc@latest -p

To verify that everything is working you can run the following

npm config get registry

# Or using yarn
yarn info <package_in_devops_registry>

Usage

Add a registry to the global .npmrc file

npx devops-npmrc@latest

Add a .npmrc file to a project

npx devops-npmrc@latest -p

Available options

  • -p, --projectGenerate a .npmrc file for a project instead of a global file
  • -V, --versionoutput the version number
  • -h, --helpdisplay help

Yarn

If you are using yarn you can select yarn when asked what package manager you are using, this will generate both a .npmrc file and a .yarnrc.yml file.


Contribute

If you wish to contribute, here are some steps to get started:

  1. Fork the repo and clone it to your local machine.
  2. Install dependencies by running yarn
  3. Make your changes
  4. Build and bundle the project
  5. Push to github and submit a pull request

Build and bundle the project

Build the project

yarn build

Bundle the project

yarn bundle

Run the executable (located in the bin directory)

yarn run-bin
1.0.5

9 months ago

1.0.4

9 months ago

1.0.3

9 months ago

1.0.2

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago