bash $ n_shell --no_globalshelljs $ typeof ls // not in the global namespace'undefined'shelljs $ shell.ls() // uses 'shell' prefixLICENSEREADME.mdbinnode_modulespackage.jsonsrctmpshelljs $ shell.pwd()/path/to/dir
But I want to use a different namespace
You're covered:
bash $ n_shell --no_global=$shelljs $ $.ls() // now uses '$' as the prefixLICENSEREADME.mdbinnode_modulespackage.jsonsrctmpshelljs $ $.pwd()/path/to/dir
But I want to use a different version of ShellJS
Just install that version locally (npm install shelljs) and start up
n_shell with the --path option:
--global: Start a node REPL with the equivalent of
require('shelljs/global'). This is the default behavior.
--no_global [PREFIX], --local [PREFIX], -n [PREFIX]: Start a node REPL
with the equivalent of var PREFIX = require('shelljs'). PREFIX defaults
to shell, if not specified.
--use_strict: enforce strict mode (default is false)
--prompt <FORMAT>: use this format to generate the REPL prompt. Default is
"shelljs %v%l $ "
%%: a literal % sign
%v: show the current version (from package.json)
%l: show [local] if this is using a local version of ShellJS
--noinspect: disable the default --inspect behavior. This provides
less-readable REPL output, but behaves just as a standard Node REPL would.
--path=path/to/shelljs/: the argument should be a path to a folder
containing a ShellJS package.
--inspect (default): an experimental switch to add a method to
the output of each command. The return values are still ShellStrings, but
appear more readable and shell-like. Also, commands with no arguments can be
invoked without parentheses, such as and . Recommended
for ShellJS v0.7+. Credit for the idea goes to
.
History
Similarly to n_, n_shell stores REPL history under ~/.n_shell_history.