Skip to content

Commit

Permalink
Fixes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolay-borzov committed May 25, 2019
1 parent 3806fd2 commit 2fdf63e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
19 changes: 18 additions & 1 deletion README.md
Expand Up @@ -26,7 +26,24 @@ in the bundle (perhaps because of out-of-date dependencies).

## Options

There are three output formats available - JSON, TSV and HTML. By default (`source-map-explorer foo.min.js`), source-map-explorer writes HTML to a temporary file and opens it in your default browser. But if one of formats specified (`source-map-explorer foo.min.js --json`) source-map-explorer outputs result in specified format to stdout. If filename specified (`source-map-explorer foo.min.js --json sme/result.json`) result is saved to the file
### Default behavior - write HTML to a temp file and open it in your browser
```
source-map-explorer foo.min.js
```

### Write output in specific formats to stdout
```
source-map-explorer foo.min.js --html
source-map-explorer foo.min.js --json
source-map-explorer foo.min.js --tsv
```

### Write output in specific formats to a file
```
source-map-explorer foo.min.js --html result.html
source-map-explorer foo.min.js --json result.json
source-map-explorer foo.min.js --tsv result.tsv
```

* `--json`: output JSON instead of displaying a visualization:

Expand Down
2 changes: 2 additions & 0 deletions src/cli.ts
Expand Up @@ -35,6 +35,8 @@ function parseArguments(): Arguments {
.example('$0 script.js script.js.map', 'Explore bundle')
.example('$0 script.js', 'Explore bundle with inline source map')
.example('$0 dist/js/*.*', 'Explore all bundles inside dist/js folder')
.example('$0 script.js --tsv', 'Explore and output result as TSV to stdout')
.example('$0 script.js --json result.json', 'Explore and save result as JSON to the file')
.demandCommand(1, 'At least one js file must be specified')
.options({
json: {
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Expand Up @@ -47,7 +47,7 @@ export interface ExploreOptions {
};
/** Disable removing prefix shared by all sources */
noRoot?: boolean;
/** Replace "what" by "that" map */
/** Replace "this" by "that" map */
replaceMap?: ReplaceMap;
}

Expand Down

0 comments on commit 2fdf63e

Please sign in to comment.