Skip to content

Commit

Permalink
docs(readme) added more clarification (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevewhitmore committed Jun 1, 2020
1 parent f22e523 commit 85b55e8
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Expand Up @@ -23,6 +23,10 @@ npm i minify -g

### CLI

The bash command below prompts the user to enter a code snippet to be saved in "hello.js".

Press `<enter>` after the closing `}` and then either ^D or ^C to finish the prompt.

```js
$ cat > hello.js
const hello = 'world';
Expand All @@ -31,11 +35,21 @@ for (let i = 0; i < hello.length; i++) {
console.log(hello[i]);
}
^D
```

Use the command `minify` followed by the path to and name of the js file intended to be minified. This will minify the code and output it to the screen.

```js
$ minify hello.js
const hello="world";for(let l=0;l<hello.length;l++)console.log(hello[l]);
```

You can capture the output with the following:

```js
$ minify hello.js > hello.min.js
```

### Code Example

`minify` can be used as a `promise`:
Expand Down

0 comments on commit 85b55e8

Please sign in to comment.