ngx-childprocess
Version:
Access Child Process API from Electron through Angular Service
35 lines (34 loc) • 1.11 kB
JavaScript
var ChildProcessService = (function () {
function ChildProcessService() {
}
Object.defineProperty(ChildProcessService.prototype, "child_process", {
get: function () {
if (!this._child_process) {
this._child_process = window.require ? window.require('child_process') : null;
}
return this._child_process;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ChildProcessService.prototype, "isElectronApp", {
/**
* determines if SPA is running in Electron
* @returns {boolean}
*/
get: function () {
return !!window.navigator.userAgent.match(/Electron/);
},
enumerable: true,
configurable: true
});
Object.defineProperty(ChildProcessService.prototype, "childProcess", {
get: function () {
return this.child_process ? this.child_process : null;
},
enumerable: true,
configurable: true
});
return ChildProcessService;
}());
export { ChildProcessService };