Detalhes do pacote

bower-config

bower795.9kMIT1.4.3

The Bower config reader and writer.

readme (leia-me)

bower-config

The Bower config (.bowerrc) reader and writer.

Bower can be configured using JSON in a .bowerrc file. For example:

{
  "directory": "app/components/",
  "timeout": 120000,
  "registry": {
    "search": [
      "http://localhost:8000",
      "https://registry.bower.io"
    ]
  }
}

View the complete .bowerrc specification on the website for more details. Both the bower.json and .bowerrc specifications are maintained at github.com/bower/spec.

Install

$ npm install --save bower-config

Usage

.load(overwrites)

Loads the bower configuration from the configuration files.

Configuration is overwritten (after camelcase normalisation) with overwrites argument.

This method overwrites following environment variables:

  • HTTP_PROXY with proxy configuration variable
  • HTTPS_PROXY with https-proxy configuration variable
  • NO_PROXY with no-proxy configuration variable

It also clears http_proxy, https_proxy, and no_proxy environment variables.

To restore those variables you can use restore method.

restore()

Restores environment variables overwritten by .load method.

.toObject()

Returns a deep copy of the underlying configuration object. The returned configuration is normalised. The object keys will be camelCase.

#create(cwd)

Obtains a instance where cwd is the current working directory (defaults to process.cwd);

var config = require('bower-config').create();
// You can also specify a working directory
var config2 = require('bower-config').create('./some/path');

#read(cwd, overrides)

Alias for:

var configObject = (new Config(cwd)).load(overrides).toJson();

License

Released under the MIT License.

changelog (log de mudanças)

Changelog

1.4.2

  • Prevent errors when expanded env variable does not exist

1.4.2

  • Update minimist to 0.2.1 to fix security issue

1.4.0

  • Change default shorthand resolver from git:// to https://

1.3.1

  • Ignore hook scripts for environment variable expansion

1.3.0 - 2015-12-07

  • Allow the use of environment variables in .bowerrc. Fixes #41
  • Loads the .bowerrc file from the cwd specified on the command line. Fixes bower/bower#1993
  • Allwow for array notation in ENV variables #44

1.2.3 - 2015-11-27

  • Restores env variables if they are undefined at the beginning
  • Handles default setting for config.ca. Together with bower/bower PR #1972, fixes downloading with strict-ssl using custom CA
  • Displays an error message if .bowerrc is a directory instead of file. Fixes bower/bower#2022

1.2.2 - 2015-10-16

1.2.1 - 2015-10-15

  • Fixes case insenstivity HTTP_PROXY setting issue on Windows

1.2.0 - 2015-09-28

  • Prevent defaulting cwd to process.cwd()

1.1.2 - 2015-09-27

  • Performs only camel case normalisation before merging

1.1.1 - 2015-09-27

  • Fix: Merge extra options after camel-case normalisation, instead of before it

1.1.0 - 2015-09-27

  • Allow for overwriting options with .load(overwrites) / .read(cwd, overwrites)

1.0.1 - 2015-09-27

  • Update dependencies and relax "mout" version range
  • Most significant changes:
    • graceful-fs updated from 2.x version to 4.x
    • osenv updated to from 0.0.x to 0.1.x, tmp location changed

1.0.0 - 2015-09-27

  • Support for no-proxy configuration variable
  • Overwrite HTTP_PROXY, HTTPS_PROXY, and NO_PROXY env variables in load method
  • Normalise paths to certificates with contents of them, #28

0.6.1 - 2015-04-1

  • Fixes merging .bowerrc files upward directory tree. #25

0.6.0 - 2015-03-30

0.5.2 - 2014-06-09

  • Fixes downloading of bower modules with ignores when .bowerrc is overridden with a relative tmp path. #17 bower/bower#1299

0.5.1 - 2014-05-21

  • [perf] Uses the same mout version as bower
  • [perf] Uses only relevant parts of mout. Related bower/bower#1134

0.5.0 - 2013-08-30

  • Adds a DEFAULT_REGISTRY key to the Config class that exposes the bower registry UR. #6

0.4.5 - 2013-08-28

  • Fixes crashing when home is not set

0.4.4 - 2013-08-21

  • Supports nested environment variables #8

0.4.3 - 2013-08-19

  • Improvement in argv.config parsing

0.4.2 - 2013-08-18

  • Sets interative to auto

0.4.1 - 2013-08-18

  • Generates a fake user instead of using 'unknown'

0.4.0 - 2013-08-16

  • Suffixes temp folder with the user and 'bower'

0.3.5 - 2013-08-14

  • Casts buffer to string

0.3.4 - 2013-08-11

  • Empty .bowerrc files no longer throw an error.

0.3.3 - 2013-08-11

  • Changes git folder to empty (was not being used anyway)

0.3.2 - 2013-08-07

  • Uses a known user agent by default when a proxy.

0.3.1 - 2013-08-06

  • Fixes Typo

0.3.0 - 2013-08-06

  • Appends the username when using the temporary folder.