Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
This module provides a way to synchronously load multiple Node.js modules using glob pattern matching.
Require all sibling modules (relative to this module):
var results = grequire(module, "./*.js")
console.log(results)
Output:
[{
filename: './sibling-1.js',
exports: { /* exports of sibling-1 */ }
}, {
filename: './sibling-2.js',
exports: { /* exports of sibling-2 */ }
}]
Also see the spec, it shows many different combinations of parameters, with comments.
grequire([module, ] pattern [, globOpts])
module
The module object
that requires should be performed on behalf of. Usually this should be the free module
variable, like in the example above.
pattern
, globOpts
The glob pattern and options to use when matching files. See the
node-glob documentation.
Returns an array of items, where each item corresponds to one require
d module, and
has the following contents:
{
/**
* The filename of the loaded module. It may be absolute or relative,
* depending on the pattern. See test/index.js for examples.
*/
filename: String,
/**
* The loaded module's exports.
*/
exports: AnyObject
}
This module is written in ES6, and ES5 code is generated using Babel.
If you live in the future or use Babel (or some other transpiler), you may want to load the non-transpiled ES6 code:
import grequire from 'grequire/es6'
MIT
FAQs
Synchronous require of multiple modules that match a given glob pattern
The npm package grequire receives a total of 3 weekly downloads. As such, grequire popularity was classified as not popular.
We found that grequire demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.