devops-npmrc v1.0.5
DevOps .npmrc CLI
CLI tool for adding Azure DevOps artifact feed to .npmrc on unix based systems like macOS or Linux.
Works for both
npmandyarn.
Prerequisites
To use the tool you will need:
- DevOps organization name
- DevOps artifact feed name
- A personal access token (global file only)
Find the name of your
organizationandfeed- Go to https://dev.azure.com/ and log in to your organization.
- Select the project where your feed is located and navigate to
Artifactsin the menu to the left. - Select the feed you wish to add to
.npmrcfrom the dropdown menu in the top left corner. - Retrieve
organizationandfeedfrom the url:dev.azure.com/<organization>/Your.Project/_artifacts/<feed>
Generate a
personal access token- Generate a Personal Access Token with Packaging read & write scopes.
Quick start
Before using the tool make sure you have all the prerequisites.
Add a registry to the global .npmrc file
npx devops-npmrc@latestTo 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 -pTo 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@latestAdd a .npmrc file to a project
npx devops-npmrc@latest -pAvailable options
-p,--project– Generate a.npmrcfile for a project instead of a global file-V,--version– output the version number-h,--help– display 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:
- Fork the repo and clone it to your local machine.
- Install dependencies by running
yarn - Make your changes
- Build and bundle the project
- Push to github and submit a pull request
Build and bundle the project
Build the project
yarn buildBundle the project
yarn bundleRun the executable (located in the bin directory)
yarn run-bin