Node

Edgemesh Installation instructions for Browserify, Webpack or Rollup.

This module is intended for use with an app bundler like Webpack or module bundlers like Browserify and Rollup. It will automatically inject the Edgemesh client into your application.

Installation

NPM
YARN
npm i edgemesh --save
yarn add edgemesh

Usage

ES5
ES6
require('edgemesh')()
import Edgemesh from 'edgemesh'
const edgemesh = new Edgemesh()

Any of the Client Config options can be passed to the Edgemesh constructor.

ES5
ES6
require('edgemesh')({ lite: true })
import Edgemesh from 'edgemesh'
const edgemesh = new Edgemesh({ lite: true })

If you want to do something after the Edgemesh client has loaded, you can listen to the ready event. Once Edgemesh is installed and your app is running, the Edgemesh client interface will be available on window.edgemesh.

ES5
ES6
const edgemesh = require('edgemesh')()
edgemesh.on('ready', () => {
// Set the log level
window.edgemesh.setLogLevel(window.edgemesh.LOG_LEVELS.log)
// Sync immediately
window.edgemesh.sync()
})
import Edgemesh from 'edgemesh'
const edgemesh = new Edgemesh()
edgemesh.on('ready', () => {
// Set the log level
window.edgemesh.setLogLevel(window.edgemesh.LOG_LEVELS.log)
// Sync immediately
window.edgemesh.sync()
})