deps-regex

WebJar for deps-regex

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

deps-regex
Last Version

Last Version

0.1.4
Release Date

Release Date

Type

Type

jar
Description

Description

deps-regex
WebJar for deps-regex
Project URL

Project URL

https://www.webjars.org
Source Code Management

Source Code Management

https://github.com/mathieudutour/deps-regex

Download deps-regex

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/deps-regex/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>deps-regex</artifactId>
    <version>0.1.4</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/deps-regex/
implementation 'org.webjars.npm:deps-regex:0.1.4'
// https://jarcasting.com/artifacts/org.webjars.npm/deps-regex/
implementation ("org.webjars.npm:deps-regex:0.1.4")
'org.webjars.npm:deps-regex:jar:0.1.4'
<dependency org="org.webjars.npm" name="deps-regex" rev="0.1.4">
  <artifact name="deps-regex" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='deps-regex', version='0.1.4')
)
libraryDependencies += "org.webjars.npm" % "deps-regex" % "0.1.4"
[org.webjars.npm/deps-regex "0.1.4"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

deps-regex

Regular expression for matching javascript require statements.

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

Install

Install with npm

$ npm i deps-regex --save

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");';

Running tests

Install dev dependencies:

$ npm i -d && npm test

Contributing

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

License

Released under the MIT license.

Versions

Version
0.1.4