UNPKG

ember-cli-dependency-checker

Version:

Ember CLI addon for detecting missing npm and bower dependencies before executing ember commands

19 lines (16 loc) 367 B
'use strict'; var path = require('path'); var fs = require('fs'); function readFile(path){ if (fs.existsSync(path)) { return fs.readFileSync(path); } } module.exports = function readPackageJSON(projectRoot) { var filePath = path.join(projectRoot, 'package.json'); try { return JSON.parse(readFile(filePath)); } catch (e) { return null; } };