nefertiti-node
Version:
ES module to work with Nefertiti crypto trade bot.
67 lines (51 loc) • 1.18 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getArch = getArch;
exports.getPlatform = getPlatform;
var _os = require("os");
/* eslint-disable consistent-return */
/* eslint-disable default-case */
/*
Returns the system platform/OS, corresponding to Nefertiti release assets naming structure.
May not support all platforms
*/
function getPlatform() {
switch ((0, _os.platform)()) {
case 'aix':
case 'freebsd':
case 'linux':
case 'openbsd':
return 'linux';
case 'darwin':
case 'sunos':
return 'darwin';
case 'win32':
return 'windows';
}
}
/*
Returns the system architecture, corresponding to the release assets naming structure.
Cross-referenced between node.js docs and Nefertiti supported archs
*/
function getArch() {
switch ((0, _os.arch)()) {
case 'arm':
return 'arm';
case 'arm64':
return 'arm64';
case 'x32':
return '386';
case 'x64':
return 'amd64';
case 'mips':
return 'mips';
case 'mipsel':
return 'mipsle';
case 'ppc64':
return 'ppc64';
case 's390x':
return 's390x';
}
}