fs.binary
fs.binary
Function
Read the binary content of the file.
Syntax
fs(path).binary()
Parameters
No parameters.
Return value
| Type | Description |
|---|---|
| Array | Returns an array of bytes, each element being an Int from 0 to 255. |
Example
file = fs('docs-bin.txt') file.write('BT') result = file.binary() // Output: [66,84] print result
Notes
- Suitable for reading non-text files or content that needs to be processed byte by byte.