
Security News
npm Introduces minimumReleaseAge and Bulk OIDC Configuration
npm rolls out a package release cooldown and scalable trusted publishing updates as ecosystem adoption of install safeguards grows.
match-requires
Advanced tools
Match require statements in a string. Returns an array of matching require statements. Each match is an object with line number, variable name, and module name. Statements in code comments are ignored.
Match require statements in a string. Returns an array of matching require statements. Each match is an object with line number, variable name, and module name. Statements in code comments are ignored.
npm i match-requires --save-dev
npm test
var re = require('match-requires');
console.log(re('require(\'a-b-c\');\nvar fooBar = require(\'foo-bar\');'))
Returns:
[ { line: 1,
variable: '',
module: 'a-b-c',
original: 'require(\'a-b-c\');' },
{ line: 2,
variable: 'fooBar',
module: 'foo-bar',
original: 'var fooBar = require(\'foo-bar\');' } ]
Jon Schlinkert
Copyright (c) 2014 Jon Schlinkert
Released under the MIT license
This file was generated by verb on November 17, 2014.
FAQs
Match require statements in a string. Returns an array of matching require statements. Each match is an object with line number, variable name, and module name. Statements in code comments are ignored.
The npm package match-requires receives a total of 179 weekly downloads. As such, match-requires popularity was classified as not popular.
We found that match-requires demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
npm rolls out a package release cooldown and scalable trusted publishing updates as ecosystem adoption of install safeguards grows.

Security News
AI agents are writing more code than ever, and that's creating new supply chain risks. Feross joins the Risky Business Podcast to break down what that means for open source security.

Research
/Security News
Socket uncovered four malicious NuGet packages targeting ASP.NET apps, using a typosquatted dropper and localhost proxy to steal Identity data and backdoor apps.