open-index/open-npm huggingface dataset:
npm package: @m-lab/msak
Description: Client for the MSAK multi-stream throughput measurement protocol
Author: M-Lab
Latest version: 0.3.1

# msak-js

JavaScript client library for the [MSAK](https://github.com/m-lab/msak)
multi-stream throughput measurement protocol.

## How to build

A [Node.js](https://nodejs.org/) environment (preferably the latest LTS, 20.x)
is required.

```bash
# Clone the repository
git clone https://github.com/m-lab/msak-js
cd msak-js

# Install dependencies
$ npm install

# Build the project
$ npm run build-prod
```

This will build the library and write the resulting UMD module in `dist/msak.js`

## How to use

Include `msak.js` in your HTML page:

```html
 <script src="msak.js" type="text/javascript"></script>
```

Create a new `msak.Client`, specifying your client name and version and providing your custom callbacks:

```js
let client = new msak.Client(CLIENTNAME, CLIENTVERSION, {
    onDownloadResult: (result) => {
        console.log(result);
    },
    onDownloadMeasurement: (measurement) => {
        console.log(measurement);
    },
    onUploadResult: (result) => {
        console.log(result);
    },
    onUploadMeasurement: (measurement) => {
        console.log(measurement);
    },
    onError: (err) => {
        console.log("error: " + err);
    }
});
```

For a complete example, see [index.html](index.html).
npm package: @m-lab/ndt7
Description: NDT7 client for measuring networks
Author: Measurement Lab
Latest version: 0.1.4

# ndt7-js

The official [NDT7](https://github.com/m-lab/ndt-server) Javascript client
library. This code works in all modern browsers and is the source for the npm
package [`@m-lab/ndt7`](https://www.npmjs.com/package/@m-lab/ndt7).

Includes an example web client in the `examples/` directory. Pull requests
gratefully accepted if you would like to write a more sophisticated web client
that uses the returned measurements to debug network conditions.

In case you need a standalone client binary that you can build and run on
multiple operating systems and CPU architectures (including embedded devices)
have a look at the
[official Go client](https://github.com/m-lab/ndt7-client-go) instead.

## API Reference

{{#namespace name="ndt7"}}
{{>main}}
{{/namespace}}