New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

connect-repl

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

connect-repl - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

31

lib/repl.js

@@ -6,4 +6,6 @@

var context;
var replDisabled = !process.env.NODE_ENV || process.env.NODE_ENV == "production"
var setEmptyNext = function() {

@@ -15,7 +17,3 @@ context.next = function() { console.log("Nothing to continue"); };

function repl() {
// always disable on production
if(process.env.NODE_ENV == "production")
return function connectREPLdisabled(req, res, next) { next(); };
function ensureContextExists() {
if(!context) {

@@ -26,2 +24,13 @@ context = require('repl').start("REPL> ").context;

}
}
function repl() {
// always disable on production
if(replDisabled)
return function connectREPLdisabled(req, res, next) { next(); };
ensureContextExists();
return function connectREPL(req, res, next) {

@@ -50,1 +59,13 @@ if(!context)

};
GLOBAL.REPL_EXPORT = repl.replExport = function replExport(name, value) {
if(replDisabled) return;
ensureContextExists();
console.log('REPL: Value exported to this["' + name + '"] (type ' + (typeof value) + ')');
context[name] = value;
};

2

package.json
{
"name": "connect-repl",
"version": "0.0.2",
"version": "0.0.3",
"description": "Inject REPL as Connect or Express middleware",

@@ -5,0 +5,0 @@ "keywords": ["repl", "connect", "express", "middleware", "debug", "interactive"],

@@ -15,2 +15,7 @@ # node-connect-repl

## REPL_EXPORT global function
Module exports **global** function `REPL_EXPORT(name, value)` which can be called anywhere.
Provided value is accesible by `name` in REPL.
## Example

@@ -17,0 +22,0 @@

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