0.0.6 • Published 8 years ago
component-lookup v0.0.6
component-lookup
Look for components and gather information about them.
Install
npm install component-lookupUsage
const componentLookup = require('component-lookup')
componentLookup('*/[^_]*.njk')
componentLookup('*/[^_]*.njk', { cwd: __dirname })
componentLookup('*/[^_]*.njk', { dataPaths: (fileName) => [ `${ fileName }.data.js` ] })Parameters
pattern{String}- Files to look for using a glob pattern.opts{?Object}- Options. -cwd{?String}- Directory in which to look for components. Defaults toprocess.cwd(). -dataPaths{?Function}- Function that returns an array of paths to tellcomponent-lookupthe location of potential data files.
Returns
{Object}- Components and their information.