🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

deps-regex

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deps-regex

Regular expression for matching javascript require/import statements.

0.2.0
latest
Source
npm
Version published
Weekly downloads
1.2M
-14.91%
Maintainers
1
Weekly downloads
 
Created
Source

deps-regex

Regular expression for matching javascript require/import statements.

This is pretty fragile and created for perf reasons where using a real parser would be overkill.

Install

Install with npm

npm install --save deps-regex

Usage

var DepsRegex = require("deps-regex");
var re = new DepsRegex({
  matchInternal: true,
  matchES6: true,
  matchCoffeescript: true,
});

re.getDependencies("var foo = require('bar');");
// => [ 'bar']

Known false positives

module.exports = 'require("false-positive");';

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Running tests

Install dev dependencies:

npm install && npm test

License

Released under the MIT license.

Keywords

exec

FAQs

Package last updated on 28 Sep 2021

Did you know?

Socket

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.

Install

Related posts