Get the encoding of a buffer
Uses getEncodingSync
behind the scenes.
forwarded to getEncodingSync
forwarded to getEncodingSync
accepts arguments: (error: Error, result: Boolean)
nothing
Get the encoding of a buffer. We fetch a bunch chars from the start, middle and end of the buffer. We check all three, as doing only start was not enough, and doing only middle was not enough, so better safe than sorry.
(
Error
|
string
)
:
either an Error instance if something went wrong, or if successful "utf8" or "binary"
Is Binary
Uses isText
behind the scenes.
forwarded to isText
forwarded to isText
accepts arguments: (error: Error, result: Boolean)
nothing
Is Binary (Synchronous)
Uses isTextSync
behind the scenes.
(
Error
|
boolean
)
Is Text
Uses isTextSync
behind the scenes.
forwarded to isTextSync
forwarded to isTextSync
accepts arguments: (error: Error, result: Boolean)
nothing
Is Text (Synchronous) Determine whether or not a file is a text or binary file. Determined by extension checks first, then if unknown extension, will fallback on encoding detection. We do that as encoding detection cannot guarantee everything, especially for chars between utf8 and utf16
the filename for the file/buffer if available
the buffer for the file if available
(
Error
|
boolean
)