blinkstick.js
function BlinkStick (device, serialNumber, manufacturer, product) {

    if (isWin) {
        if (device) {
            this.device = new usb.HID(device);
            this.serial = serialNumber;
            this.manufacturer = manufacturer;
            this.product = product;
        }
    } else {
        if (device) {
            device.open ();
            this.device = device;
        }
    }

    this.inverse = false;
    this.animationsEnabled = true;

    var self = this;

    this.getSerial(function (err, result) {
        if (typeof(err) === 'undefined')
        {
            self.requiresSoftwareColorPatch = self.getVersionMajor() == 1 &&
                self.getVersionMinor() >= 1 && self.getVersionMinor() <= 3;
        }
    });
}
function BlinkStick (device, serialNumber, manufacturer, product) {

    if (isWin) {
        if (device) {
            this.device = new usb.HID(device);
            this.serial = serialNumber;
            this.manufacturer = manufacturer;
            this.product = product;
        }
    } else {
        if (device) {
            device.open ();
            this.device = device;
        }
    }

    this.inverse = false;
    this.animationsEnabled = true;

    var self = this;

    this.getSerial(function (err, result) {
        if (typeof(err) === 'undefined')
        {
            self.requiresSoftwareColorPatch = self.getVersionMajor() == 1 &&
                self.getVersionMinor() >= 1 && self.getVersionMinor() <= 3;
        }
    });
}
function BlinkStick ( device , serialNumber , manufacturer , product ) { if ( isWin ) { if ( device ) { this . device = new usb . HID ( device ) ; this . serial = serialNumber ; this . manufacturer = manufacturer ; this . product = product ; } } else { if ( device ) { device . open ( ) ; this . device = device ; } } this . inverse = false ; this . animationsEnabled = true ; var self = this ; this . getSerial ( function ( err , result ) { if ( typeof ( err ) === 'undefined' ) { self . requiresSoftwareColorPatch = self . getVersionMajor ( ) == 1 && self . getVersionMinor ( ) >= 1 && self . getVersionMinor ( ) <= 3 ; } } ) ; }
Initialize new BlinkStick device

@class BlinkStick
@constructor
@param {Object} device The USB device as returned from "usb" package.
@param {String} [serialNumber] Serial number of the device. Used only in Windows.
@param {String} [manufacturer] Manufacturer of the device. Used only in Windows.
@param {String} [product] Product name of the device. Used only in Windows.
Initialize new BlinkStick device