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

derequire

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

derequire - npm Package Compare versions

Comparing version 0.2.1 to 0.3.0

4

index.js

@@ -8,3 +8,3 @@ 'use strict';

tokenFrom = tokenFrom || 'require';
var ast = esprima.parse(code);
var ast = esprima.parse('!function(){'+code+'}');
estraverse.traverse(ast,{

@@ -20,4 +20,4 @@ leave:function(node, parent) {

});
return escodegen.generate(ast);
return escodegen.generate(ast.body[0].expression.argument.body.body[0]);
}
module.exports = rename;
{
"name": "derequire",
"version": "0.2.1",
"version": "0.3.0",
"description": "remove requires",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -12,2 +12,6 @@ var should = require('chai').should();

});
it('should handle top level return statments', function(){
var exampleText = 'return require("require");';
derequire(exampleText).should.equal("return __derequire__('require');");
});
});
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