0.3.0 • Published 2 months ago

@m-lab/msak v0.3.0

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
2 months ago

msak-js

JavaScript client library for the MSAK multi-stream throughput measurement protocol.

How to build

A Node.js environment (preferably the latest LTS, 20.x) is required.

# 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:

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

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

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.

0.3.0

2 months ago

0.2.0

3 months ago

0.1.0

4 months ago

0.0.1

4 months ago