UNPKG

435 BJavaScriptView Raw
1/* eslint-env node */
2const glob = require('glob');
3const path = require('path');
4const extname = require('path-complete-extname');
5
6module.exports = (path_to_js)=>{
7 let pathToJS = path.join(...path_to_js, '*.js*')
8 return glob.sync(pathToJS).reduce((map, entry)=>{
9 const basename = path.basename(entry, extname(entry))
10 const localMap = map
11 localMap[basename] = './' + path.basename(entry)
12 return localMap
13 }, {})
14}
\No newline at end of file