Skip to content

Latest commit

 

History

History
23 lines (15 loc) · 382 Bytes

write.md

File metadata and controls

23 lines (15 loc) · 382 Bytes

write

write(fd: number, buf: Buffer): number;
  • fd - file descriptor
  • buf - Buffer with data to write

Writes data from buffer buf to file descriptor fd.

Returns number of bytes writte on success, or a negative error number.

Example

Write to console

const STDOUT = 1;
const buf = Buffer.from('Hello world!\n');

libjs.write(STDOUT, buf);