Skip to content

Commit 22a5e03

Browse files
committed
Use jsonfile instead of fs-extra
1 parent 1594588 commit 22a5e03

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

cli.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env node
22
'use strict';
3-
const fs = require('fs-extra');
3+
const jsonfile = require('jsonfile');
44
const inquirer = require('inquirer');
55
const findPkg = require('pkg-up');
66

@@ -22,7 +22,7 @@ async function main() {
2222
const pkgPath = await findPkg();
2323
if (!pkgPath) throw new Error('No package.json file found!');
2424

25-
const pkg = await fs.readJson(pkgPath);
25+
const pkg = await jsonfile.readFile(pkgPath);
2626

2727
if (!pkg.scripts) pkg.scripts = {};
2828

@@ -41,7 +41,7 @@ async function main() {
4141
delete pkg.scripts[script];
4242
} else pkg.scripts[script] = val;
4343

44-
await fs.writeJson(pkgPath, pkg, { spaces: 2 });
44+
await jsonfile.writeFile(pkgPath, pkg, { spaces: 2 });
4545
}
4646

4747
main().catch(err => {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
"format": "eslint . --fix && prettier --write *.{js,md,yaml,json}"
2323
},
2424
"dependencies": {
25-
"fs-extra": "^8.0.0",
2625
"inquirer": "^6.3.1",
26+
"jsonfile": "^5.0.0",
2727
"pkg-up": "^3.1.0"
2828
},
2929
"devDependencies": {

0 commit comments

Comments
 (0)