A toolkit for network diagnostics including speed tests, port availability checks, and more.
.vscode | ||
test | ||
ts | ||
.gitignore | ||
.gitlab-ci.yml | ||
.snyk | ||
license | ||
npmextra.json | ||
package-lock.json | ||
package.json | ||
readme.md | ||
tslint.json |
@pushrocks/smartnetwork
network diagnostics
Availabililty and Links
Status for master
Usage
import * as smartnetwork from 'smartnetwork';
const testSmartNetwork = new smartnetwork.SmartNetwork();
const run = async () => {
// measure average speed over a period of 5 seconds
// the structure of speedResult is self explanatory using TypeScript (or the linked TypeDoc above)
const speedResult: smartnetwork.SpeedResult = testSmartNetwork.getSpeed(5000);
// you can check for local ports before trying to bind to it from your nodejs program
const isLocalPortUnused: boolean = await testSmartNetwork.isLocalPortUnused(1234);
// you can run basic port checks on remote domains.
const isRemotePortAvailable: boolean = await testSmartNetwork.isRemotePortAvailable(
'google.com:80'
);
// just another way to call for the same thing as above
const isRemotePortAvailable: boolean = await testSmartNetwork.isRemotePortAvailable(
'google.com',
80
);
};
Contribution
We are always happy for code contributions. If you are not the code contributing type that is ok. Still, maintaining Open Source repositories takes considerable time and thought. If you like the quality of what we do and our modules are useful to you we would appreciate a little monthly contribution: You can contribute one time or contribute monthly. :)
For further information read the linked docs at the top of this readme.
MIT licensed | © Lossless GmbH | By using this npm module you agree to our privacy policy