Usage
There are two builds in dist
folder:
dist/netflux.es2015.es.js // ES2015 code & ES bundle (export/import)
dist/netflux.es5.umd.min.js // ES5 code minified & UMD bundle
ES2015 module
dist/netflux.es2015.es.js
Recommended for using along with RollupJS
, SystemJS
or any other ES2015 module loader.
If you consider to use Rollup, check jsnext:main. Netflux supports it.
import {create, BotServer, WEB_RTC, WEB_SOCKET} from 'netflux'
If you do not use jsnext:main then:
import {create, BotServer, WEB_RTC, WEB_SOCKET} from './node_modules/netflux/dist/netflux.es2015.es.js'
UMD module
dist/netflux.es5.umd.min.js
Universal Module Definition module is compatible with AMD, CommonJS and "global" modules. It works in browser and NodeJS.
Browser
<script src="netflux.es5.umd.min.js">
window.netflux !== undefined // true
</script>
CDN
- Release: https://cdn.rawgit.com/coast-team/netflux/v1.0.0-rc.4/dist/netflux.es5.umd.min.js
- Nightly: https://github.com/coast-team/netflux/blob/master/dist/netflux.es2015.es.js
NodeJS
const netflux = require('netflux')