0.0.3 • Published 11 years ago

better-require v0.0.3

Weekly downloads
906
License
-
Repository
github
Last release
11 years ago

Adds file formats supported by require(). Will always return a JSON representation.

Supported file types are: json, yaml, csv, xml, ini.

Install

npm install better-require

Example

require('better-require')('json');

var config = require('./config.json');
console.log(config);

Enable support for mutliple file types:

require('better-require')('json yaml xml');

// we can now require .xml, .yaml and .xml files!
var config = require('./config.yaml');
console.log(config);

Dependencies

Reference

http://nodejs.org/api/all.html#all_require_extensions