Socket
Book a DemoInstallSign in
Socket

localrc

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

localrc

A project-local version of rc, chainable with the original.

latest
Source
npmnpm
Version
0.1.2
Version published
Maintainers
1
Created
Source

localrc

The non-configurable project-local configuration loader for lazy people.

Usage

The only two options are the name of your app and your default configuration.

  var localrc = require('localrc')(appname, {
    //defaults go here.
    port: 2468
  })

Standards

Given your application name, localrc will look in all the obvious project-local places for configuration.

  • For each config folder sibling to your node_modules folders:
    • config/${arch}(.json)
    • config/${platform}(.json)
    • config/${hostname}(.json)
    • config/${username}(.json)
    • config/${APPNAME}_ENV(.json)
    • config/defaults(.json)
  • And config.json as a sibling file to node_modules.

All configuration sources that where found will be flattened into one object, so that sources earlier in this list override later ones.

Formats

Configurations files must be in json format.

Chaining

An example for the unimaginative:

  var rc = require('rc')(appname, require('localrc')(appname, {
    foo: 'bar'
  }))

Keywords

config

FAQs

Package last updated on 16 Jun 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.