Skip to content

Commit

Permalink
doc: generalize the docs in README
Browse files Browse the repository at this point in the history
No change to logic. Now that this plugin uses `util.inspect.custom` over
the `.inspect` attribute directly (see issue #9), this rewrites the docs
accordingly.
  • Loading branch information
nfischer committed Jan 17, 2022
1 parent 11bf301 commit 0efebee
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
[![npm](https://img.shields.io/npm/v/shelljs-plugin-inspect.svg?style=flat-square)](https://www.npmjs.com/package/shelljs-plugin-inspect)
[![shelljs-plugin](https://img.shields.io/badge/shelljs-plugin-brightgreen.svg?style=flat-square)](https://github.com/shelljs/shelljs/wiki/Using-ShellJS-Plugins)

A [ShellJS](https://github.com/shelljs/shelljs) plugin to add `.inspect()`
methods for REPL use.
A [ShellJS](https://github.com/shelljs/shelljs) plugin to add custom REPL
inspection for ShellJS output. This turns hard-to-read `ShellString` objects
into nicely formatted text (resembling what the actual unix commands would
output).

## Installation

Expand All @@ -14,14 +16,17 @@ $ npm install --save shelljs
$ npm install --save shelljs-plugin-inspect
```

## Usage
**Tip:** If you want to use this plugin (and more REPL goodies), check out my
project [n\_shell](https://github.com/nfischer/n_shell) to get a REPL with
ShellJS loaded by default!

Use this plugin in a Node REPL like so:
## Usage

Without this plugin:
Here's what ShellJS looks like by default in the REPL:

```javascript
> shell.cat('file1.txt'); // Yuck!
> // Before this plugin: hard-to-read ShellString objects
> shell.cat('file1.txt');
{ [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,
Expand All @@ -41,6 +46,7 @@ Without this plugin:
After:

```
> // After this plugin: nicely formatted text!
> require('shelljs-plugin-inspect');
> shell.cat('file.txt');
These are the file contents
Expand Down

0 comments on commit 0efebee

Please sign in to comment.