-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.js
29 lines (25 loc) · 924 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
var processValue = require('./lib/util/valueProcessor');
var piGlowInterface = require('./lib/interface');
var PiGlowBackend = require('./lib/PiGlowBackend');
var PiGlowBackendMock = require('./lib/PiGlowBackendMock');
var BackendMockPrettyPrint = require('./lib/PiGlowBackendMockPrettyPrint');
/**
* convenience constructor function
*/
function createPiGlow(callback) {
var myPiGlow = new PiGlowBackend();
var myInterface = piGlowInterface(myPiGlow);
myPiGlow
.on('initialize', function() {
callback(null, myInterface);
})
.on('error', function(error) {
callback(error, null);
});
}
createPiGlow.Backend = PiGlowBackend;
createPiGlow.BackendMock = PiGlowBackendMock;
createPiGlow.BackendMockPrettyPrint = BackendMockPrettyPrint;
createPiGlow.piGlowInterface = piGlowInterface;
createPiGlow.processValue = processValue;
module.exports = createPiGlow;