Skip to content Skip to sidebar Skip to footer

Browserify - Create Bundle With External Module

I'm really new to browserify world. I want to use this module peer-file, in order to allow the file transfer between two browsers. Reading the Usage section into readme, I note I h

Solution 1:

If you look at the index file - https://github.com/michaelrhodes/peer-file/blob/master/index.js

It adds send and receive to the exports. So you first get a handle to that, then you can access the exports with dot notation.

var send = require('peer-file').send;
var receive = require('peer-file').receive;

Or just get it once:

var peerFile = require('peer-file');

// Later
peerFile.send..
peerFile.receive..

Post a Comment for "Browserify - Create Bundle With External Module"