Comparing version 0.5.0 to 0.5.1
26
index.js
#!/usr/bin/env node | ||
'use strict'; | ||
// ShellJS plugins | ||
require('shelljs-plugin-inspect'); | ||
var repl = require('repl'); | ||
@@ -59,13 +62,14 @@ var argv = require('minimist')(process.argv.slice(2)); | ||
// Polyfill .inspect() method | ||
if (!ret.inspect) ret.inspect = function() { | ||
if (key === 'echo' || key === 'exec') return ''; | ||
if (key === 'pwd' || key === 'which') | ||
return this.stdout.match(/\n$/) ? this.stdout : this.stdout + '\n'; | ||
if (this.hasOwnProperty('stdout')) | ||
return this.stdout; | ||
else if (Array.isArray(this)) | ||
return this.join('\n'); | ||
else | ||
return this; | ||
}; | ||
function emptyInspect() { | ||
return ''; | ||
} | ||
var oldInspect = ret.inspect.bind(ret); | ||
if (key === 'echo' || key === 'exec') { | ||
ret.inspect = emptyInspect; | ||
} else if (key === 'pwd' || key === 'which') { | ||
ret.inspect = function () { | ||
var oldResult = oldInspect(); | ||
return oldResult.match(/\n$/) ? oldResult : oldResult + '\n'; | ||
}; | ||
} | ||
} | ||
@@ -72,0 +76,0 @@ return ret; |
{ | ||
"name": "n_shell", | ||
"version": "0.5.0", | ||
"version": "0.5.1", | ||
"description": "A node REPL with ShellJS loaded by default", | ||
@@ -33,3 +33,4 @@ "main": "index.js", | ||
"require-relative": "^0.8.7", | ||
"shelljs": "*" | ||
"shelljs": "*", | ||
"shelljs-plugin-inspect": "^0.1.0" | ||
}, | ||
@@ -36,0 +37,0 @@ "devDependencies": { |
# n\_shell | ||
[![npm](https://img.shields.io/npm/v/n_shell.svg?style=flat-square)](https://www.npmjs.com/package/n_shell) | ||
A node REPL with ShellJS loaded by default. | ||
@@ -4,0 +6,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8436
91
150
7
+ Addedshelljs@0.7.8(transitive)
+ Addedshelljs-plugin-inspect@0.1.0(transitive)