Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: generalize the docs in README #15

Merged
merged 1 commit into from
Jan 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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