nodejsscript • Docs
nodejsscript / s
This namespace refers to shelljs
, for docs visits shelljs/shelljs.
You can pipe commands when make sense by chaining, see Pipes.
Available commands: cat · cd · chmod · cp · pushd · popd · dirs · find · grep · head · ln · ls · mkdir · mv · pwd · rm · sed · sort · tail · test · touch · uniq · which · error · errorCode
s.cat("./package.json").grep("version");
… this library adds:
Changes/recommenctions:
- use echo instead of
s.echo
, this was changed tos.ShellString
for easy file writing without logging to consoles.echo("Data").to("file.txt")
. - use 'run()'/'runA()' instead of
s.exec
, because of options for passing arguments in secure way. - use '$()' instead of
s.set()
, because$()
allows chaining (you can also access config with $s.is_*
keys). - use $.xdg
.temp
instead ofs.tempdir()
– the$.xdg.*
provides more paths than just temp directory.
- XargsOptions
- XargsFunction
- DollarFunction
- RunFunction
- RunAsyncFunction
- ReadOptions
- ShellReturnValueNJS
- ListFunction
- FindFunction
- CopyFunction
- RemoveFunction
- MoveFunction
- MkdirFunction
- CatFunction
- SedFunction
- GrepFunction
- EchoFunction
- PushDirFunction
- PopDirFunction
- DirsFunction
- LinkFunction
- ExecFunction
- ExecOptions
- ExecOutputReturnValue
- ShellReturnValue
- ShellStringConstructor
- ChmodFunction
- TouchOptionsArray
- TouchFunction
- HeadOptions
- HeadFunction
- SortFunction
- TailOptions
- TailFunction
- UniqFunction
- ShellConfig