Start Building for Free
CircleCI.comBlogCommunitySupport
  • Orb Quick Start Guide
  • Usage Examples
    • setting_registry
  • Commands
  • Orb Source
  1. Orbs
  2. cobli/npm-config@1.0.0

cobli/npm-config@1.0.0

Sections
Changes npm configuration
Created: September 23, 2019Version Published: September 24, 2019Releases: 3
Org Usage:
33

Orb Quick Start Guide

Use CircleCI version 2.1 at the top of your .circleci/config.yml file.

1 version: 2.1

Add the orbs stanza below your version, invoking the orb:

1 2 orbs: npm-config: cobli/npm-config@1.0.0

Use npm-config elements in your existing workflows and jobs.

Opt-in to use of uncertified orbs on your organization’s Security settings page.

Read more in the docs here.

Usage Examples

setting_registry

Sets a registry in NPM client (~/.npmrc)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 version: 2.1 orbs: npm-config: cobli/npm-config@x.x.x jobs: test: docker: - image: circleci/node:9.11.2 steps: - checkout - npm-config/set-registry: registry-prurl: //your.registry.domain.net/path/ scope: '@your-scope' auth-token: your-repo-token - run: name: Download depencies command: yarn - run: name: Test command: yarn test

Commands

set-registry

Sets a registry to .npmrc

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
registry-prurl
protocol-relative URL (ex: //registry.domain.net/path/)
Required
protocol-relative URL (ex: //registry.domain.net/path/)
Yes
-
type: string
string
scope
registry scope
Required
registry scope
Yes
-
type: string
string
auth-token
authorization token for private repos
authorization token for private repos
No
''
type: string
string

Orb Source

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 # This code is licensed from CircleCI to the user under the MIT license. # See here for details: https://circleci.com/developer/orbs/licensing --- version: 2.1 description: Changes npm configuration examples: setting_registry: description: Sets a registry in NPM client (~/.npmrc) usage: version: 2.1 orbs: npm-config: cobli/npm-config@x.x.x jobs: test: docker: - image: circleci/node:9.11.2 steps: - checkout - npm-config/set-registry: registry-prurl: //your.registry.domain.net/path/ scope: "@your-scope" auth-token: "your-repo-token" - run: name: Download depencies command: yarn - run: name: Test command: yarn test commands: set-registry: description: Sets a registry to .npmrc parameters: registry-prurl: description: | protocol-relative URL (ex: //registry.domain.net/path/) type: string scope: description: registry scope type: string auth-token: description: authorization token for private repos type: string default: "" steps: - run: name: Set NPM registry URL command: > scope=<< parameters.scope >>; registry_prurl=<< parameters.registry-prurl >>; npm config set "${scope}:registry" "https:$registry_prurl" - run: name: Set auth token for NPM registry if provided command: | if [ "<< parameters.auth-token >>" != "" ]; then registry_prurl=<< parameters.registry-prurl >>; auth_token=<< parameters.auth-token >>; echo "${registry_prurl}:_authToken=${auth_token}" >> ~/.npmrc fi;
Developer Updates
Get tips to optimize your builds
Or join our research panel and give feedback
By submitting this form, you are agreeing to ourTerms of UseandPrivacy Policy.