Compare commits

...

6 Commits

Author SHA1 Message Date
34bee225d5 1.1.12 2019-09-08 15:52:02 +02:00
ccece078a2 fix(core): update 2019-09-08 15:52:01 +02:00
a04151e537 1.1.11 2019-09-08 15:19:16 +02:00
d71346e763 fix(core): update 2019-09-08 15:19:16 +02:00
817894b6ce 1.1.10 2019-09-08 14:59:47 +02:00
bba219ddef fix(core): update 2019-09-08 14:59:47 +02:00
5 changed files with 12 additions and 11 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartnetwork",
"version": "1.1.9",
"version": "1.1.12",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartnetwork",
"version": "1.1.9",
"version": "1.1.12",
"private": false,
"description": "network diagnostics",
"main": "dist/index.js",

View File

@ -25,7 +25,7 @@ tap.test('should scan a port', async () => {
});
tap.test('should get the default gateways', async () => {
const gatewayResult = await testSmartNetwork.getDefaultGateway();
const gatewayResult = await testSmartNetwork.getGateways();
console.log(gatewayResult);
});

View File

@ -129,11 +129,8 @@ export class SmartNetwork {
return result;
}
public async getDefaultGateway() {
const result = {
v4: await plugins.defaultGateway.v4(),
v6: await plugins.defaultGateway.v6()
};
public async getGateways() {
const result = plugins.os.networkInterfaces();
return result;
}
}

View File

@ -1,4 +1,9 @@
// native scope
import * as os from 'os';
export {
os
};
// @pushrocks scope
import * as smartpromise from '@pushrocks/smartpromise';
@ -6,9 +11,8 @@ import * as smartstring from '@pushrocks/smartstring';
export { smartpromise, smartstring };
// @third party scope
import defaultGateway from 'default-gateway';
// @third party scope
const speedtestNet = require('speedtest-net');
import * as portscanner from 'portscanner';
export { defaultGateway, speedtestNet, portscanner };
export { speedtestNet, portscanner };