@wotermelon/require-context
v1.0.0
Published
require.context for Nodejs
Downloads
1
Maintainers
Readme
require.context for Nodejs
alias webpack require.context()
Install
npm install require-context
Quick Start
const requireContext = require('@wotermelon/require-context')
const fileModules = requireContext('./', false, /\.js$/)
// {
// './index.js': module
// }
API
requireContext(dir, useSubdirectories, regExp)
dir
Which directory to find, can be an absolute path.useSubdirectories
Whether to traverse subdirectories recursively. Defaule isfalse
.regExp
To match the file path.