43 lines
2.3 KiB
Markdown
43 lines
2.3 KiB
Markdown
# @pushrocks/smartnetwork
|
|
network diagnostics
|
|
|
|
## Availabililty and Links
|
|
* [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/smartnetwork)
|
|
* [gitlab.com (source)](https://gitlab.com/pushrocks/smartnetwork)
|
|
* [github.com (source mirror)](https://github.com/pushrocks/smartnetwork)
|
|
* [docs (typedoc)](https://pushrocks.gitlab.io/smartnetwork/)
|
|
|
|
## Status for master
|
|
[](https://gitlab.com/pushrocks/smartnetwork/commits/master)
|
|
[](https://gitlab.com/pushrocks/smartnetwork/commits/master)
|
|
[](https://www.npmjs.com/package/@pushrocks/smartnetwork)
|
|
[](https://snyk.io/test/npm/@pushrocks/smartnetwork)
|
|
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
|
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
|
[](https://prettier.io/)
|
|
|
|
## Usage
|
|
|
|
```typescript
|
|
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 = testSmartNetwork.getSpeed(5000)
|
|
|
|
//
|
|
const isLocalPortAvailable: boolean = await testSmartNetwork.isLocalPortAvailable(1234);
|
|
const isRemotePortAvailable: boolean = await testSmartNetwork.isRemotePortAvailable('google.com:80');
|
|
const isRemotePortAvailable: boolean = await testSmartNetwork.isRemotePortAvailable('google.com', 80);
|
|
}
|
|
```
|
|
|
|
For further information read the linked docs at the top of this readme.
|
|
|
|
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
|
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
|
|
|
|
[](https://maintainedby.lossless.com)
|