"use strict"; const {platform, type} = require("os"); const supportedPlatforms = new Set([ "aix", "android", "darwin", "freebsd", "linux", "openbsd", "sunos", "win32" ]); const plat = platform(); if (supportedPlatforms.has(plat)) { let file = plat; if (plat === "aix") { file = type() === "OS400" ? "ibmi" : "sunos"; // AIX `netstat` output is compatible with Solaris } const m = require(`./${file}.js`); module.exports.v4 = () => m.v4(); module.exports.v6 = () => m.v6(); module.exports.v4.sync = () => m.v4.sync(); module.exports.v6.sync = () => m.v6.sync(); } else { const err = new Error(`Unsupported Platform: ${plat}`); module.exports.v4 = () => Promise.reject(err); module.exports.v6 = () => Promise.reject(err); module.exports.v4.sync = () => { throw err; }; module.exports.v6.sync = () => { throw err; }; }
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
LICENSE | File | 1.26 KB | 0644 |
|
README.md | File | 1.77 KB | 0644 |
|
android.js | File | 940 B | 0644 |
|
darwin.js | File | 1.34 KB | 0644 |
|
freebsd.js | File | 1.01 KB | 0644 |
|
ibmi.js | File | 1.02 KB | 0644 |
|
index.js | File | 867 B | 0644 |
|
linux.js | File | 1.51 KB | 0644 |
|
openbsd.js | File | 1.08 KB | 0644 |
|
package.json | File | 781 B | 0644 |
|
sunos.js | File | 1.08 KB | 0644 |
|
win32.js | File | 3.1 KB | 0644 |
|