Socket
Socket
Sign inDemoInstall

shell-emulator

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

shell-emulator - npm Package Compare versions

Comparing version 1.0.1 to 1.0.3

16

index.js

@@ -6,8 +6,6 @@ // initialize with ID (string) of field that should act like a shell,

// shell functions for
// * setCaretPosition
// * postMessage
// * scrollDown
// * interrupt
exports.create = function (shellArea, historyArea, shellFunctions) {
exports.create = function (shell, historyArea, shellFunctions) {
var keys = {

@@ -29,9 +27,9 @@ // The keys 37, 38, 39 and 40 are the arrow keys.

var setCaretPosition = shellFunctions['setCaretPosition'];
var postMessage = shellFunctions['postMessage'];
var scrollDown = require('scroll-down').now;
var interrupt = shellFunctions['interrupt'];
var setCaretPosition = require('set-caret-position');
var scrollDown = require('scroll-down');
var mathProgramOutput = "";
var shell = shellArea;
var history = historyArea;

@@ -87,3 +85,3 @@ var cmdHistory = []; // History of commands for shell-like arrow navigation

var packageAndSendMessage = function (tail, notrack) {
setCaretPosition(shell, shell.val().length);
setCaretPosition(shell.attr('id'), shell.val().length);
if (shell.val().length >= mathProgramOutput.length) {

@@ -130,3 +128,3 @@ l = shell.val().length;

if (e.keyCode == keys.enter) {
setCaretPosition(shell, shell.val().length);
setCaretPosition(shell.attr('id'), shell.val().length);
}

@@ -150,3 +148,3 @@

if (pos < mathProgramOutput.length) {
setCaretPosition(shell, shell.val().length);
setCaretPosition(shell.attr('id'), shell.val().length);
}

@@ -153,0 +151,0 @@ // This deals with backspace.

{
"name": "shell-emulator",
"version": "1.0.1",
"version": "1.0.3",
"description": "Emulate a shell in the browser",

@@ -33,4 +33,5 @@ "main": "index.js",

"dependencies": {
"scroll-down": "1.0.0"
"scroll-down": "2.0.0",
"set-caret-position": "3.0.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