Normalize config formats, expand globbing/minimatch patterns and read-in JSON/YAML data files.
npm i plasma --savevar plasma = require('plasma');
plasma.find({src: ['*.json']});If an object with a src property is passed in, plasma will attempt to expand any glob/minimatch patterns into an array of resolved filepaths.
Normalize config formats for source files, so that any of the following will work:
{src: ''}{data: {src: ''}}{data: [{src: ''}, {src: ''}]}
Returns an object with two properties:
raw: array of objects that do not have src properties will be pushed into therawproperty so that globule doesn't try to search for filepaths when they don't exist.data: array of objects withsrcproperties, each of which is an array of filepaths or un-expanded glob patterns.
Process patterns in the src properties of objects passed from plasma.normalize(). Uses plasma.find() to expand each src property into an array of resolved filepaths.
Actually read-in data from src files.
Manipulate the final output into either an array of objects, or an object of objects.
Until mocha tests are implemented, run node test/test.
node-configfiles by Tyler Kellen influenced some of the code in this lib, especially the approach for normalizing config formats. Thanks, Tyler!
Jon Schlinkert
Copyright (c) 2014 Jon Schlinkert, contributors. Released under the MIT license
