How to use the write function from bindings
Find comprehensive JavaScript bindings.write code examples handpicked from public code repositorys.
GitHub: taoyuan/ni2c
78 79 80 81 82 83 84 85 86
if (!Buffer.isBuffer(data)) { data = Buffer.from(<any[]>data); } const answer = await fromCallback(cb => wire.write(data, cb)); await tick(); return answer; }
90
0
2
+ 9 other calls in file
GitHub: jwerle/stordb
39 40 41 42 43 44 45 46 47 48
* @param {Number} fd * @param {Buffer|String} buf */ export function write (fd, buf) { return bindings.write(fd, buf, buf.length); } /** * Print formatted text to `fd'
3
25
10
+ 9 other calls in file
122 123 124 125 126 127 128 129 130 131
SerialPort.prototype.write = function (b) { if (Buffer.isBuffer(b)) serialport_native.write(this.fd, b); else serialport_native.write(this.fd, new Buffer(b)); }; SerialPort.prototype.end = function(buf, enc) {
0
5
4
+ 19 other calls in file
GitHub: pass0a/pcan
31 32 33 34 35 36 37 38 39 40
_destroy() { bindings.close(this.inst); } _final() {} _write(chunk: any, encoding: string, next: () => void) { bindings.write(this.inst, chunk); next(); } isOpened() { return this.inst ? true : false;
1
0
0
122 123 124 125 126 127 128 129 130 131
if (!this.isOpen) { return asyncError(cb, new Error('Port is not open')); } binding.write(this.fd, buffer, cb); }; const commonMethods = [ 'drain',
0
0
1
+ 11 other calls in file
bindings.createKey is the most popular function in bindings (8616 examples)