https://github.com/agencypmg/node-lazyloader
A dynamic file loader for NodeJS, loads files if they are in a directory
https://github.com/agencypmg/node-lazyloader
Last synced: 3 months ago
JSON representation
A dynamic file loader for NodeJS, loads files if they are in a directory
- Host: GitHub
- URL: https://github.com/agencypmg/node-lazyloader
- Owner: AgencyPMG
- License: mit
- Created: 2015-04-14T13:17:37.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-08-14T18:09:36.000Z (almost 10 years ago)
- Last Synced: 2024-04-14T06:49:35.115Z (about 1 year ago)
- Language: JavaScript
- Size: 191 KB
- Stars: 1
- Watchers: 17
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/AgencyPMG/node-lazyloader)
[](https://coveralls.io/r/AgencyPMG/node-lazyloader)
[](http://badge.fury.io/js/node-lazyloader)# node-lazyloader
A dynamic file loader for NodeJS, loads files (via require) if they are in a directory## Install
```
npm install lazyloader
```## How to Use
```js
var LazyLoader = require('node-lazyloader');var lazy = new LazyLoader({
debug: true, //gives you more verbose output
filter: function(file) {
//compare a file to block out
if ('donotincludefile.js' === file) {
return false;
}
return true;
},
post_filter: function(obj) {
if (obj instanceof MyParentClass) {
return true;
}
return false;
}
});var allFiles = lazy.fetch('/path/to/node/files');
```