@pddstudio/shelljs-plugin-bash-exec

0.0.1 • Public • Published

shelljs-plugin-inspect

Travis AppVeyor npm shelljs-plugin

A ShellJS plugin to add .inspect() methods for REPL use.

Installation

$ npm install --save shelljs
$ npm install --save shelljs-plugin-inspect

Usage

Use this plugin in a Node REPL like so:

Without this plugin:

> shell.cat('file1.txt'); // Yuck!
{ [String: 'These are the file contents\nAnd they\'re printed out nicely!\n']
  stdout:'These are the file contents\nAnd they\'re printed out nicely!\n',
  stderr: null,
  code: 0,
  cat: [Function: bound ],
  head: [Function: bound ],
  tail: [Function: bound ],
  to: [Function: bound ],
  toEnd: [Function: bound ],
  sed: [Function: bound ],
  sort: [Function: bound ],
  uniq: [Function: bound ],
  grep: [Function: bound ],
  exec: [Function: bound ] }

After:

> require('shelljs-plugin-inspect');
> shell.cat('file.txt');
These are the file contents
And they're printed out nicely!

> shell.ls();
file.txt
otherfile.txt
...

> shell.pwd();
path/to/current/directory

Writing ShellJS plugins

If you're interested in taking a look at the current state of the ShellJS plugin API, take a look at index.js. This has helpful comments explaining the necessary boilerplate for writing a plugin. For an example usage of the plugin, take a look at test/test.js.

Package Sidebar

Install

npm i @pddstudio/shelljs-plugin-bash-exec

Weekly Downloads

1

Version

0.0.1

License

MIT

Unpacked Size

4.53 kB

Total Files

5

Last publish

Collaborators

  • pddstudio