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

replie

Package Overview
Dependencies
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

replie - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

.gitmodules

18

index.js

@@ -5,3 +5,19 @@ 'use strict';

module.exports = REPLIE;
/*
REPLIE Options
{
prompt: {String} Repl Command Line Prompt,
server: {Object} Express server instance, leave undefined and pass options.startSever to have replie create a server instance,
port: {Number} Port for express server to listen on, will default to 5000 if not specified (this is only used if you are passing options.startServer),
modules: {Array} Array of internal and external modules for replie to load into its context, see example below,
namespace: {String} Optional namespacing for web socket,
logger: {Function} Optional logger function, defaults to console.log,
onError: {Function} Error handling function,
connectionUrl: {String} Optional connection path if replie is starting server,
templatePath: {String} File path for html if replie is starting server,
connectionMessage: {String} Message for socket emitter on connection,
replConnectionCallback: {Function} Optional socket connection callback function defaults to emitting connectionMessage,
serverConnectionCallback: {Function} Optional server connection callback if replie is starting server, defaults to sendFile using templatePath
}
*/
// Example

@@ -8,0 +24,0 @@ // var repl = new REPLIE({

@@ -104,3 +104,6 @@ 'use strict';

};
if (this.server && !options.startServer) {
if (options.io_server) {
this.io = options.io_server;
}
else if (this.server && !options.startServer) {
this.io = sockets(this.server);

@@ -137,2 +140,3 @@ }

stream.resume = function () {};
stream.pause = function () {};
socket.on('stdin', function (data) {

@@ -142,5 +146,17 @@ stream.emit('data', data + '\r\n');

};
this._getStream = function () {
return stream;
};
if (typeof this.namespace === 'string') {
this.namespaces[this.namespace] = this.io.of('/' + this.namespace);
this.namespaces[this.namespace].on('connection', function (socket) {
socket.on('disconnect', function () {
self.disconnect();
});
socket.on('end', function () {
self.disconnect();
});
socket.on('close', function () {
self.disconnect();
});
configureConnection.call(self, socket);

@@ -160,2 +176,11 @@ });

configureConnection.call(self, socket);
socket.on('disconnect', function () {
self.disconnect();
});
socket.on('end', function () {
self.disconnect();
});
socket.on('close', function () {
self.disconnect();
});
});

@@ -173,6 +198,18 @@ this.io.on('error', function (err) {

REPLIE.prototype.disconnect = function () {
this.logger('User Disconnected');
var self = this,
rp = self._getREPL();
if (rp) {
self._getStream().emit('data', '.exit\r\n');
}
return self;
};
REPLIE.prototype.extendContext = function (options, callback) {
var self = this,
context = self._getREPL().context,
extend = function (nodeModule) {
return new Bluebird(function (resolve, reject) {
return new Bluebird(function (resolve) {
if (typeof nodeModule === 'object') {

@@ -187,3 +224,3 @@ if (nodeModule.type === 'internal') {

else {
self.context[path.basename(nodeModule.name, '.js')] = require(path);
context[path.basename(nodeModule.name, '.js')] = require(path);
resolve();

@@ -195,3 +232,3 @@ }

if (nodeModule.name === 'shelljs') {
self.context.exec = exec;
context.exec = exec;
resolve();

@@ -203,3 +240,3 @@ }

var mod = require(nodeModule.name);
self.context[contextName] = mod;
context[contextName] = mod;
resolve();

@@ -212,3 +249,3 @@ }

var installed = require(nodeModule.name);
self.context[contextName] = installed;
context[contextName] = installed;
resolve();

@@ -215,0 +252,0 @@ }

{
"name": "replie",
"version": "1.0.1",
"version": "1.0.2",
"description": "A basic web socket based repl",

@@ -14,11 +14,56 @@ "main": "index.js",

],
"author": "Jan Bialostok",
"license": "ISC",
"author": {
"name": "Jan Bialostok",
"email": "janbialostok@gmail.com",
"url": "https://github.com/janbialostok"
},
"contributors": [{
"name": "Yaw Joseph Etse",
"email": "yaw.etse@gmail.com",
"url": "http://about.me/yawjosephetse"
}],
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/janbialostok/Replie.git"
},
"dependencies": {
"bluebird": "^3.0.5",
"express": "^4.13.3",
"shelljs": "^0.5.3",
"socket.io": "^1.3.7",
"util-extend": "^1.0.1"
}
},
"devDependencies": {
"express": "^4.13.3",
"socket.io": "^1.3.7"
},
"gitHead": "fb22d1d67078d6ac68ae457fe431462e8d66d17e",
"bugs": {
"url": "https://github.com/janbialostok/Replie/issues"
},
"homepage": "https://github.com/janbialostok/Replie#readme",
"_id": "replie@1.0.191",
"_shasum": "d75b4fcfe4f7a41fd43821a14aecdd708221f8d8",
"_from": "replie@*",
"_npmVersion": "2.11.2",
"_nodeVersion": "0.12.6",
"_npmUser": {
"name": "janbialostok",
"email": "janbialostok@gmail.com"
},
"dist": {
"shasum": "d75b4fcfe4f7a41fd43821a14aecdd708221f8d8",
"tarball": "http://registry.npmjs.org/replie/-/replie-1.0.191.tgz"
},
"maintainers": [
{
"name": "janbialostok",
"email": "janbialostok@gmail.com"
},{
"name": "Yaw Joseph Etse",
"email": "yaw.etse@gmail.com",
"url": "http://about.me/yawjosephetse"
}
],
"directories": {},
"_resolved": "https://registry.npmjs.org/replie/-/replie-1.0.191.tgz"
}
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