Skip to content

Commit 36f79aa

Browse files
committed
Update dependencies and make input file required
1 parent cff7c2d commit 36f79aa

File tree

5 files changed

+40
-42
lines changed

5 files changed

+40
-42
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Install by running `npm i -g source-map-unpacker`
66
# Usage
77

88
```
9-
Usage: source-map-unpacker [options]
9+
Usage: unmap [options]
1010
1111
Options:
1212
-p, --path <p> input map file

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"name": "source-map-unpacker",
3-
"version": "1.5.1",
3+
"version": "1.5.2",
44
"description": "",
55
"main": "unmap.js",
66
"bin": {
77
"unpack": "unmap.js"
88
},
99
"scripts": {
10-
"test": "node . -p test/gistfile1.txt -o out"
10+
"test": "node . -p test/gistfile1.js.map -o out"
1111
},
1212
"repository": {
1313
"type": "git",
@@ -23,11 +23,11 @@
2323
"author": "Anthony Ou",
2424
"license": "MIT",
2525
"dependencies": {
26-
"commander": "8.2.0",
27-
"fs-extra": "10.0.0"
26+
"commander": "9.3.0",
27+
"fs-extra": "10.1.0"
2828
},
2929
"devDependencies": {
30-
"@types/commander": "^2.12.2",
31-
"@types/fs-extra": "^9.0.13"
30+
"@types/fs-extra": "9.0.13",
31+
"@types/node": "18.0.0"
3232
}
3333
}

pnpm-lock.yaml

Lines changed: 21 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unmap.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,26 @@
11
#!/usr/bin/env node
22

3-
const fs = require('fs-extra');
4-
const { resolve } = require('path');
5-
const { Command } = require('commander');
3+
const fs = require("fs-extra");
4+
const { resolve } = require("path");
5+
const { Command } = require("commander");
66
const program = new Command();
77

88
const opts = program
9-
.option('-p, --path <p>', 'input source map file')
10-
.option('-f, --filter <f>', 'filter out file names')
11-
.option('-o, --output <o>', 'output folder', './')
9+
.name("unmap")
10+
.requiredOption("-p, --path <p>", "input source map file")
11+
.option("-f, --filter <f>", "filter out file names")
12+
.option("-o, --output <o>", "output folder", "./")
1213
.parse(process.argv)
1314
.opts();
1415

16+
// stat output folder
1517
fs.stat(opts.output)
16-
.then(async (exists) => {
18+
.then(async () => {
19+
// if output folder exists continue
1720
return fs.readFile(opts.path);
1821
})
19-
.catch(async () => {
22+
.catch(async (e) => {
23+
// if output folder does not exist, make it.
2024
await fs.mkdir(opts.output);
2125
return fs.readFile(opts.path);
2226
})

0 commit comments

Comments
 (0)