modules-scan
v1.0.1
Published
Utility library
Downloads
1,261
Readme
node-modules-scan
Utility library to search for Types/Classes/Subclasses in project folders.
Example
const requireType = require('modules-scan').byType
const BaseType = require(resolve('test/assets/base-info-contributor'))
// find all subclasses of base type and instantiate them
const contributors = requireType(".", BaseType, {excludeBaseType: true}).map(Constructor => new Constructor())
Installation
npm install modules-scan --save
Documentation
License
This project is distributed under the MIT license.