stfsy / node-modules-scan

Utility to lookup certain Classes/Types in NodeJS Environments

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

node-modules-scan

Build Status Dependency Status DevDependency Status Npm downloads Npm Version Git tag Github issues License

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.

About

Utility to lookup certain Classes/Types in NodeJS Environments

License:MIT License


Languages

Language:JavaScript 83.1%Language:Shell 16.9%