Skip to content

Commit 1eaa0c6

Browse files
popomoreatian25
authored andcommitted
refactor: use utility to read json (#122)
1 parent 0f2beaa commit 1eaa0c6

2 files changed

Lines changed: 16 additions & 15 deletions

File tree

lib/loader/egg_loader.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const debug = require('debug')('egg-core');
88
const homedir = require('node-homedir');
99
const FileLoader = require('./file_loader');
1010
const ContextLoader = require('./context_loader');
11+
const utility = require('utility');
1112
const utils = require('../utils');
1213

1314

@@ -35,7 +36,7 @@ class EggLoader {
3536
* @see {@link AppInfo#pkg}
3637
* @since 1.0.0
3738
*/
38-
this.pkg = require(path.join(this.options.baseDir, 'package.json'));
39+
this.pkg = utility.readJSONSync(path.join(this.options.baseDir, 'package.json'));
3940

4041
/**
4142
* All framework directories.

package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,35 +33,35 @@
3333
"version": "6, 7, 8"
3434
},
3535
"devDependencies": {
36-
"autod": "^2.8.0",
36+
"autod": "^2.10.1",
3737
"coffee": "^4.1.0",
38-
"egg-bin": "^4.0.5",
38+
"egg-bin": "^4.3.5",
3939
"egg-ci": "^1.8.0",
40-
"eslint": "^4.2.0",
41-
"eslint-config-egg": "^5.0.0",
42-
"js-yaml": "^3.9.0",
43-
"mm": "^2.1.0",
44-
"mz-modules": "^1.0.0",
40+
"eslint": "^4.9.0",
41+
"eslint-config-egg": "^5.1.1",
42+
"js-yaml": "^3.10.0",
43+
"mm": "^2.2.0",
44+
"mz-modules": "^2.0.0",
4545
"pedding": "^1.1.0",
46-
"rimraf": "^2.6.1",
46+
"rimraf": "^2.6.2",
4747
"spy": "^1.0.0",
4848
"supertest": "^3.0.0"
4949
},
5050
"dependencies": {
5151
"co": "^4.6.0",
52-
"debug": "^2.6.8",
53-
"depd": "^1.1.0",
52+
"debug": "^3.1.0",
53+
"depd": "^1.1.1",
5454
"egg-logger": "^1.6.0",
5555
"egg-path-matching": "^1.0.0",
5656
"extend2": "^1.0.0",
5757
"globby": "^6.1.0",
5858
"inflection": "^1.12.0",
59-
"is-type-of": "^1.0.0",
60-
"koa": "^1.4.0",
59+
"is-type-of": "^1.2.0",
60+
"koa": "^1.4.1",
6161
"koa-router": "^5.4.2",
62-
"node-homedir": "^1.0.0",
62+
"node-homedir": "^1.1.0",
6363
"ready-callback": "^2.0.1",
64-
"utility": "^1.12.0"
64+
"utility": "^1.13.1"
6565
},
6666
"files": [
6767
"index.js",

0 commit comments

Comments
 (0)