jfig
JSON file loader or JSON pass through
Last updated 12 years ago by scottcorgan .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install jfig 
SYNC missed versions from official npm registry.

jfig

JSON file loader or JSON pass through.

I needed a way to not have to know if the data passed into the function was a file path or an object. If it is a filename, this module tries to load the file. If it is an object, it just returns the object.

Install

npm install jfig --save

Usage

File path

var jfig = require('jfig');

var something = __dirname + '/config.json';
var config = jfig(something);

Object pass through

var jfig = require('jfig');

var something = {
  type: 'object'
};
var config = jfig(something);

API

jsfig(data[, options])

  • data - file path or object to parse
  • options
    • root - the root path if a file path is provided
    • pluck - a string or array of keys to plucks the values out of the config file or object

Run Test

npm install
npm test

Current Tags

  • 1.2.0                                ...           latest (12 years ago)

3 Versions

  • 1.2.0                                ...           12 years ago
  • 1.1.0                                ...           12 years ago
  • 1.0.0                                ...           12 years ago
Maintainers (1)
Downloads
Total 4
Today 0
This Week 0
This Month 4
Last Day 0
Last Week 4
Last Month 0
Dependencies (5)
Dev Dependencies (3)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE