multiload
v3.0.2
Published
nodejs: simple file loader
Downloads
2
Readme
multiload
npm install multiload
Load multiple files at once
Usage
extension
const multiload = require('multiload')
const path = require('path')
const source = path.join(__dirname, 'articles')
const articles = multiload(source, { extension: 'html' })
contents.foo // 'bar'
exclude
exclude given modules
const multiload = require('multiload')
const path = require('path')
const source = path.join(__dirname, 'articles')
const articles = multiload(source, {
extension: 'html',
exclude: 'foo'
});
articles.foo // undefined
recursive
find modules in subfolders
const multiload = require('multiload')
const path = require('path')
const source = path.join(__dirname, 'articles')
const articles = multiload(source, {
extension: 'html',
recursive: true
});
articles.foo // 'bar'
articles['bar/baz'] // 'foo'