Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

requires-regex

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

requires-regex - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

2

package.json
{
"name": "requires-regex",
"description": "Regular expressions for node.js require statements.",
"version": "0.1.0",
"version": "0.1.1",
"homepage": "https://github.com/jonschlinkert/requires-regex",

@@ -6,0 +6,0 @@ "author": {

@@ -18,11 +18,14 @@ /*!

it('should match require statements without a var', function () {
console.log(re().exec('var isDir = require(\'is-directory\');'));
it('should return the full statement, variable name, and module path', function () {
var m = re().exec('var isDir = require(\'is-directory\');');
m[0].should.equal('var isDir = require(\'is-directory\')');
m[1].should.equal('var isDir = ');
m[2].should.equal('isDir');
m[3].should.equal('is-directory');
});
it('should match require statements without a var', function () {
console.log('var path = require(\'path\');\n\nvar list = require(\'dirs\');'.match(re()));
it('should return an array of matches', function () {
var m = 'var path = require(\'path\');\n\nvar list = require(\'dirs\');'.match(re());
m.should.eql([ 'var path = require(\'path\')', 'var list = require(\'dirs\')' ]);
});
});
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