1.0.2 • Published 10 years ago

xsettings v1.0.2

Weekly downloads
1
License
PUBLIC DOMAIN
Repository
github
Last release
10 years ago

xsettings

Because there’s already a module just named “settings”

This is a simple module which gives access to a configuration file for a node application, either in YAML, JSON or INI format.

Install

Install with npm

npm install xsettings

YAML Example

settings.yml:

auth:
    username: mike
    password: mysecret

main.js:

var settings = require("xsettings");
console.log(settings.auth.username); // mike

INI Example

settings.ini:

[auth]
username = mike
password = mysecret

main.js:

var settings = require("xsettings");
console.log(settings.auth.username); // mike

JSON Example

settings.json:

{
    "auth": {
        "username": "mike",
        "password": "mysecret"
    }
}

main.js:

var settings = require("xsettings");
console.log(settings.auth.username); // mike

Custom Settings File

config.json:

{
    "auth": {
        "username": "mike",
        "password": "mysecret"
    }
}

main.js:

var config = require("xsettings")("config.json");
console.log(config.auth.username); // mike

License

PUBLIC DOMAIN

really, it's too simple to qualify for copyright, no?

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago