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

n_shell

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

n_shell - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

2

package.json
{
"name": "n_shell",
"version": "0.1.0",
"version": "0.1.1",
"description": "A node REPL with ShellJS loaded by default",

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

@@ -90,2 +90,10 @@ # n_shell

- `--use_strict`: enforce strict mode (default is false)
- `--prompt <FORMAT>`: use this format to generate the REPL prompt. Default is
"`shelljs %v%l $ `"
- `%v`: show the current version (from `package.json`)
- `%l`: show ` [local]` if this is installed from a local module (whenever
the warning message above would be printed)
- Warn more formats options? [Let me
know](https://github.com/nfischer/n_shell/issues/new) or [send me a
PR](https://github.com/nfischer/n_shell/compare)

@@ -92,0 +100,0 @@ ## History

@@ -10,12 +10,30 @@ 'use strict';

var shell;
var json;
var isLocal;
try {
var localShellJS = path.resolve('./node_modules/shelljs');
shell = require('require-relative')(localShellJS, process.cwd());
json = require(path.join(localShellJS, 'package.json'));
isLocal = true;
console.warn('Warning: using shelljs found at ' + localShellJS);
} catch (e) {
shell = require('shelljs');
json = require('shelljs/package.json')
isLocal = false;
}
// Create the prompt
var myprompt = argv.prompt || 'shelljs %v%l $ ';
myprompt = myprompt.replace(/%./g, (function() {
var option = {
'%v': json.version,
'%l': (isLocal ? ' [local]' : '')
};
return function(match) {
return option[match];
}
})());
var replServer = repl.start({
prompt: "shelljs $ ",
prompt: myprompt,
replMode: process.env.NODE_REPL_MODE === 'strict' || argv['use_strict'] ? repl.REPL_MODE_STRICT : repl.REPL_MODE_MAGIC

@@ -22,0 +40,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