Skip to content

vanioinformatika/node-npmrc-auth-token-retriever

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

Search auth token inside .npmrc file base on registry URL.

Installation

npm install @vanioinformatika/npmrc-auth-token-retriever --save

Usage

From CLI:

npx retrieve-auth-token --registry private-registry.organization.com

From node:

import {retrieveAuthToken} from '@vanioinformatika/npmrc-auth-token-retriever'

const token = retrieveAuthToken('private-registry.organization.com')

if (token) {
    // Do something with token
} else {
    // Token not found in .npmrc file
}

If registry is not set, then default npmjs registry will be used (registry.npmjs.org).

Note: Typescript declaration files are included in package.

About

Retrieve auth token from .npmrc file base on provided registry URL

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors