UNPKG

nats-micro

Version:

NATS micro compatible extra-lightweight microservice library

22 lines 931 B
"use strict"; var _a, _b; Object.defineProperty(exports, "__esModule", { value: true }); exports.localConfig = void 0; const fs_1 = require("fs"); const path_1 = require("path"); const __dirname_js_1 = require("./__dirname.js"); function findPackageJson(path = __dirname_js_1._dirname) { const ppath = (0, path_1.join)(path, 'package.json'); if ((0, fs_1.existsSync)(ppath)) return JSON.parse((0, fs_1.readFileSync)(ppath, 'utf8')); const dir = (0, path_1.dirname)(path); if (dir !== '') return findPackageJson(dir); return undefined; } const pjson = findPackageJson(); exports.localConfig = { name: String((_a = pjson === null || pjson === void 0 ? void 0 : pjson.name) !== null && _a !== void 0 ? _a : 'nats-micro'), version: String((_b = pjson === null || pjson === void 0 ? void 0 : pjson.version) !== null && _b !== void 0 ? _b : '0.0.0'), }; //# sourceMappingURL=localConfig.js.map