abiToNodeRange

This commit is contained in:
igorklopov 2016-08-12 16:07:57 +03:00
parent 44318e2273
commit 3da49f160a
3 changed files with 17 additions and 2 deletions

View File

@ -1,2 +1,8 @@
import * as system from './system.js';
export function need (nodeRangeOrAbi, platform, arch) {
const nodeRange = system.abiToNodeRange(nodeRangeOrAbi);
console.log(nodeRange);
}
export { system };

View File

@ -4,6 +4,14 @@ function getAbi () {
return 'm' + process.versions.modules;
}
export function abiToNodeRange (abi) {
if (/^m?14/.test(abi)) return '0.12';
if (/^m?46/.test(abi)) return '4';
if (/^m?47/.test(abi)) return '5';
if (/^m?48/.test(abi)) return '6';
return abi;
}
export function toFancyPlatform (platform) {
if (platform === 'darwin') return 'osx';
if (platform === 'win32') return 'win';

View File

@ -50,10 +50,11 @@
"expand-template": "1.0.2",
"mkdirp-promise": "2.0.0",
"request": "2.74.0",
"rimraf-promise": "2.0.0"
"rimraf-promise": "2.0.0",
"semver": "5.3.0"
},
"devDependencies": {
"ava": "^0.16.0",
"ava": "0.16.0",
"babel-eslint": "6.0.4",
"babel-plugin-transform-async-to-generator": "6.8.0",
"babel-plugin-transform-es2015-modules-commonjs": "6.8.0",