UNPKG

recime-bot-runtime

Version:

This runtime is intended to run inside a micro-service container with platform specific integration and module interpreter.

30 lines (29 loc) 937 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var fs = require("fs"); var Package = /** @class */ (function () { function Package(uid) { this.uid = uid; } Package.prototype.readMetadata = function () { var _this = this; return new Promise(function (resolve, reject) { var filePath = (process.env.HOME_DIR || __dirname) + "/" + _this.uid + "/package.json"; fs.readFile(filePath, 'utf-8', function (err, data) { if (err) { reject(err); } else { var json = JSON.parse(data); resolve({ name: json.name, title: json.title, owner: json.owner }); } }); }); }; return Package; }()); exports.Package = Package;