Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/m-lab/msak-js
JavaScript client for MSAK's multi-stream throughput measurement protocol
https://github.com/m-lab/msak-js
Last synced: about 1 month ago
JSON representation
JavaScript client for MSAK's multi-stream throughput measurement protocol
- Host: GitHub
- URL: https://github.com/m-lab/msak-js
- Owner: m-lab
- License: apache-2.0
- Created: 2023-09-05T12:44:12.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-06-13T11:16:33.000Z (7 months ago)
- Last Synced: 2024-10-29T14:43:50.699Z (about 2 months ago)
- Language: JavaScript
- Size: 146 KB
- Stars: 0
- Watchers: 8
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
```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).