jsadvent/lib/_pollute/index.js

16 lines
349 B
JavaScript
Raw Permalink Normal View History

2020-12-10 08:33:00 +00:00
const fs = require('fs');
const path = require('path');
for (const filename of fs.readdirSync(__dirname)) {
if (filename === 'index.js' || !filename.endsWith('.js')) {
continue;
}
const resolved = path.resolve(__dirname, filename);
if (!fs.statSync(resolved).isFile()) {
continue;
}
require(resolved);
}
module.exports = true;