Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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
  • Socket score

Version published
Maintainers
1
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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc