1. bower-config
The Bower config reader and writer.
bower-config
Package: bower-config
Created by: bower
Last modified: Mon, 13 Jun 2022 05:00:43 GMT
Version: 1.4.3
License: MIT
Downloads: 840,891
Repository: https://github.com/bower/bower/tree/master/packages/bower-config

Install

npm install bower-config
yarn add bower-config

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.

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code