0.0.6 • Published 7 years ago

component-lookup v0.0.6

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

component-lookup

Travis Build Status Coverage Status Dependencies

Look for components and gather information about them.

Install

npm install component-lookup

Usage

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 to process.cwd(). - dataPaths {?Function} - Function that returns an array of paths to tell component-lookup the location of potential data files.

Returns

  • {Object} - Components and their information.