A toolkit for network diagnostics including speed tests, port availability checks, and more.
Go to file
2022-10-22 17:39:29 +02:00
.vscode fix(core): update 2022-02-17 00:18:23 +01:00
test fix(core): update 2022-10-21 17:13:06 +02:00
ts fix(core): update 2022-10-22 17:39:29 +02:00
.gitignore fix(core): update 2020-08-12 16:30:17 +00:00
.gitlab-ci.yml fix(core): update 2022-02-17 00:18:23 +01:00
license fix(core): update 2021-04-28 13:41:55 +00:00
npmextra.json fix(core): update 2022-02-17 00:18:23 +01:00
package.json 3.0.2 2022-10-22 17:39:29 +02:00
pnpm-lock.yaml fix(core): update 2022-10-21 17:13:06 +02:00
readme.md fix(core): update 2021-04-28 13:41:55 +00:00
tsconfig.json BREAKING CHANGE(core): switch to esm 2022-03-24 23:11:53 +01:00

@pushrocks/smartnetwork

network diagnostics

Status for master

Status Category Status Badge
GitLab Pipelines pipeline status
GitLab Pipline Test Coverage coverage report
npm npm downloads per month
Snyk Known Vulnerabilities
TypeScript Support TypeScript
node Support node
Code Style Code Style
PackagePhobia (total standalone install weight) PackagePhobia
PackagePhobia (package size on registry) PackagePhobia
BundlePhobia (total size when bundled) BundlePhobia
Platform support Supports Windows 10 Supports Mac OS X

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

repo-footer