npmrc-to-env
v1.0.0
Published
<p align="center" valign="middle"> <a href="http://npm.im/npmrc-to-env"><img height="20" alt="Version" src="https://img.shields.io/npm/v/npmrc-to-env.svg?style=for-the-badge"></a> <a href="https://travis-ci.org/gtramontina/npmrc-to-env"><img height="2
Downloads
3
Readme
npmrc-to-env
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