Skip to content
This repository has been archived by the owner on Jun 17, 2021. It is now read-only.
/ libnpmconfig Public archive

Standalone library for reading/writing/managing npm configurations

License

Notifications You must be signed in to change notification settings

npm/libnpmconfig

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

libnpmconfig

npm version license Travis Coverage Status

libnpmconfig is a Node.js library for programmatically managing npm's configuration files and data.

Table of Contents

Example

const config = require('libnpmconfig')

console.log('configured registry:', config.read({
  registry: 'https://default.registry/'
}))
// => configured registry: https://registry.npmjs.org

Install

$ npm install libnpmconfig

Contributing

The npm team enthusiastically welcomes contributions and project participation! There's a bunch of things you can do if you want to contribute! The Contributor Guide outlines the process for community interaction and contribution. Please don't hesitate to jump in if you'd like to, or even ask us questions if something isn't clear.

All participants and maintainers in this project are expected to follow the npm Code of Conduct, and just generally be excellent to each other.

Please refer to the Changelog for project history details, too.

Happy hacking!

API

> read(cliOpts, builtinOpts)

Reads configurations from the filesystem and the env and returns a figgy-pudding object with the configuration values.

If cliOpts is provided, it will be merged with the returned config pudding, shadowing any read values. These are intended as CLI-provided options. Do your own process.argv parsing, though.

If builtinOpts.cwd is provided, it will be used instead of process.cwd() as the starting point for config searching.