Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
a04151e537 | |||
d71346e763 | |||
817894b6ce | |||
bba219ddef |
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartnetwork",
|
"name": "@pushrocks/smartnetwork",
|
||||||
"version": "1.1.9",
|
"version": "1.1.11",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartnetwork",
|
"name": "@pushrocks/smartnetwork",
|
||||||
"version": "1.1.9",
|
"version": "1.1.11",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "network diagnostics",
|
"description": "network diagnostics",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
|
@ -25,7 +25,7 @@ tap.test('should scan a port', async () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
tap.test('should get the default gateways', async () => {
|
tap.test('should get the default gateways', async () => {
|
||||||
const gatewayResult = await testSmartNetwork.getDefaultGateway();
|
const gatewayResult = await testSmartNetwork.getGateways();
|
||||||
console.log(gatewayResult);
|
console.log(gatewayResult);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -129,11 +129,12 @@ export class SmartNetwork {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async getDefaultGateway() {
|
public async getGateways() {
|
||||||
const result = {
|
const result = plugins.os.networkInterfaces();
|
||||||
v4: await plugins.defaultGateway.v4(),
|
|
||||||
v6: await plugins.defaultGateway.v6()
|
|
||||||
};
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async getDefaultGateWay() {
|
||||||
|
// TOTO get default gateways
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,9 @@
|
|||||||
// native scope
|
// native scope
|
||||||
|
import * as os from 'os';
|
||||||
|
|
||||||
|
export {
|
||||||
|
os
|
||||||
|
};
|
||||||
|
|
||||||
// @pushrocks scope
|
// @pushrocks scope
|
||||||
import * as smartpromise from '@pushrocks/smartpromise';
|
import * as smartpromise from '@pushrocks/smartpromise';
|
||||||
@ -7,8 +12,7 @@ import * as smartstring from '@pushrocks/smartstring';
|
|||||||
export { smartpromise, smartstring };
|
export { smartpromise, smartstring };
|
||||||
|
|
||||||
// @third party scope
|
// @third party scope
|
||||||
import defaultGateway from 'default-gateway';
|
|
||||||
const speedtestNet = require('speedtest-net');
|
const speedtestNet = require('speedtest-net');
|
||||||
import * as portscanner from 'portscanner';
|
import * as portscanner from 'portscanner';
|
||||||
|
|
||||||
export { defaultGateway, speedtestNet, portscanner };
|
export { speedtestNet, portscanner };
|
||||||
|
Reference in New Issue
Block a user