lark
Version:
A node.js framework based on koa. Our goal is to build the best industrial node.js framework for high concurrency and high flow application.
24 lines (20 loc) • 520 B
JavaScript
/**
* Load configs from package.json
* If key 'lark' exists in package.json, lark will use
* package['lark'] as the config source.
**/
;
const misc = require('vi-misc');
const PACKAGE_JSON = 'package.json';
module.exports = () => {
let appPackage = null;
const packagePath = misc.path.absolute(PACKAGE_JSON);
try {
appPackage = require(packagePath);
}
catch (error) {
appPackage = {};
}
appPackage.lark = appPackage.lark || {};
return appPackage;
};