Gathering detailed insights and metrics for es6-requireindex
Gathering detailed insights and metrics for es6-requireindex
Gathering detailed insights and metrics for es6-requireindex
Gathering detailed insights and metrics for es6-requireindex
npm install es6-requireindex
Typescript
Module System
Node Version
NPM Version
70.9
Supply Chain
85.4
Quality
75.7
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
4 Stars
19 Commits
1 Forks
1 Watchers
1 Branches
1 Contributors
Updated on May 30, 2024
Latest Version
0.3.10
Package Id
es6-requireindex@0.3.10
Size
4.76 kB
NPM Version
3.6.0
Node Version
5.6.0
Published on
Jun 23, 2016
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Requires the modules in a directory, with support for es6-style exports (aka export default
), and the browser via webpack.
If a module exports a default object, requireIndex will expose the default object as the module's export (instead of exposing an object with the default
property referencing the es6 default export).
1// Short form. eg. in index.js 2module.exports = require('es6-requireindex')();
1// With options 2var requireIndex = require('es6-requireindex'); 3var targetDir = path.join(__dirname, 'somedir'); 4 5module.exports = requireIndex(somedir, { 6 recursive: true|false, // Default: true 7 requireES6Defaults: true|false // Default: true 8});
If you want to use it with webpack to require a folder, you must do:
1var ctx = require.context(__dirname, true, /^(.*\.((js|jsx)$))[^.]*$/igm); 2module.exports = requireIndex(ctx, [opts]);
To require all the files in a folder in an isomorphic fashion (eg with browser and server support), you can do:
1var ctx; 2 3try { 4 ctx = require.context(__dirname, true, /^(.*\.((js|jsx)$))[^.]*$/igm); 5} catch (err) {} 6 7module.exports = requireIndex(ctx);
If 'true', will require recursively through folders.
if 'true', will require the 'default' property of the required module, and when 'false', will require the whole exported object. This is helpful for es6 modules, where you can export a default object, because a es5-styled require will get the whole module, which has the default export in a property called 'default'.
npm test
Cheers.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
Found 0/19 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More