npmrc-to-env

1.0.0 • Public • Published

npmrc-to-env

Version Build Status MIT License Downloads Semantic Release

Why?

If all you have at hand is an .npmrc file, but you need exported environment variables to properly setup CI environments, for example, then this program comes in handy.

How?

$ npmrc-to-env --help
 
  Usage:
    npmrc-to-env [options]
 
  Options:
    -s --scope <scope>    Scope from which information will be extracted.
 
  Examples
    $ cat ~/.npmrc | npmrc-to-env
    $ cat ~/.npmrc | npmrc-to-env -s @myscope

You can, then, export the generated environment variables with:

export $(cat ~/.npmrc | npmrc-to-env | xargs)

Although all examples use ~/.npmrc as the source, it can be whatever .npmrc file you have.

Development

This repository holds a standard NodeJS project, so you can run all node-related commands, such as npm install, npm test, and whatnot. We do, however, use yarn do handle the dependencies. This shouldn't be a big deal, though.

Now, if you don't want to have to deal with having the right node version, yarn or whatever else installed locally, and you already have docker, then all you need to do is prefix any command you want to run with make run -- and we'll take care of everything. Like so:

$ make run -- yarn test
$ make run -- yarn test --watch
$ make run -- yarn …
$ make run -- npx …
$ make run -- sh

License

This software is licensed under the MIT license

Readme

Keywords

none

Package Sidebar

Install

npm i npmrc-to-env

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • gtramontina