node package manager
Easy collaboration. Discover, share, and reuse code in your team. Create a free org »



mPlane nodeJS reference library

This is the mPlane nodejs library. The architecture and software structure is freely inspired by mPlane reference implementation written in python by Brian Trammell


npm install mplane

Usage example

In this example we set a capability for a probe.

var mplane = require('mplane');
var MY_IP="";
// Initialize available primitives from a registry 
// Can be any valid URL or local file 
// Create a new Capability object 
var probeCapability = new mplane.Capability();
// Set time constraints 
probeCapability.set_when("now ... future / 1s");
// Add parameters with constraints 
    constraints: ""
// Results 
// Some metadata 
probeCapability.set_metadata_value("System_type","Just a TEST")
// A label to identify the capability 

Interaction with the RI

The mPlane Reference Implementation, written in python, can be find here. In order to correctly interact with any component using the RI messages formats, two method have been exposed in the library, to decode messages generated by the RI and to send messages to a RI component.


This is a global method exposed in the mplane library. It sould be used to import any raw message received from an mPlane RI component. It will generate an mplane object of the type contained in the message. In the following example the data received as a body of an HTTP communication is imported in an mPlane object.

var result = mplane.from_dict(body);


This method, defined for any mPlane information element, should be used before sending data to a RI component. The following example, shows how the pinger capability defined in the above probe example be transformed in a standard mPlane message.

/* serialize the capability in an mPlane RI message*/
var RIprobeCapability = probeCapability.to_dict();
/* Shows the serialized capability*/

This is the output of the above example

    "capability": "measure",
    "label": "This_is_a_pinger",
    "metadata": {
        "System_type": "Just a TEST",
        "System_version": "0.1a",
        "System_ID": "Pinger"
    "link": "",
    "token": "ead75d3d198ce8f45ae371246da15fd89d05de24",
    "when": "now ... future / 1s",
    "resultvalues": [],
    "results": [
    "parameters": {
        "destination.ip4": "",
        "source.ip4": ""


The base mPlane library implements the mPlane Information Model elements that can be used to build messages to be carried on top of any protocol of choice (SSH, HTTP,...). A nodejs HTTPS API has been implemented for basic usage (create and read elements) and can be find here.



A complete supervisor implementation written in javascript is available here.


A reasoner written for DEMO purpouses is available here


A probe implementing ping, traceroute and HTTP download delay is available here


Please refer to the API reference mPlane nodejs API

Release Notes

You can find release notes here


This software is released under the BSD license.