Skip to content

Discover collections of constructile instances from strings (filepaths), arrays or objects

License

Notifications You must be signed in to change notification settings

bigpipe/fabricator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fabricator

Version npmBuild StatusDependenciesCoverage Status

Discover collections of constructible instances from strings (filepaths), arrays or objects. Fabricator is a small helper module which does nothing else but detecting constructible JS entities. Strings are resolved as filepaths.

The BigPipe project is using the fabricator to find Pages and/or Pagelets. This gives developers using BigPipe more flexibility. For example, you don't have to worry about adding each Page constructor to BigPipe, simply provide the directory they reside in.

Installation

npm install fabricator --save

Usage

var fabricator = require('fabricator')
  , path = './path/to/directory/with/constructibles';
  , obj = {
      status: require('./npm-status-pagelet'),
      extended: __dirname + '/i/can/be/a/path/to/a/constructor.js'
    }

//
// Discover constructors.
//
var stack = fabricator(obj);

Tests

Make sure devDependencies are installed, after run the tests via:

npm test

About

Discover collections of constructile instances from strings (filepaths), arrays or objects

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published