Methods
decode
Parameters
Optional encoding: string
Returns string
detectEncoding
Parameters
Optional autoGuessEncoding: boolean
Protected detectEncodingByBOMFromBuffer
- detectEncodingByBOMFromBuffer(buffer: Buffer, bytesRead: number): undefined | "utf8bom" | "utf16le" | "utf16be"
Parameters
buffer: Buffer
bytesRead: number
Returns undefined | "utf8bom" | "utf16le" | "utf16be"
encodeStream
Parameters
Parameters
Optional value: string | Readable<string>
exists
- exists(encoding: string): boolean
Parameters
Returns boolean
Protected guessEncodingByBuffer
- guessEncodingByBuffer(buffer: Buffer): Promise<undefined | string>
Parameters
Returns Promise<undefined | string>
toIconvEncoding
- toIconvEncoding(encoding?: string): string
Parameters
Optional encoding: string
Returns string
toResourceEncoding
- toResourceEncoding(encoding: string, options: { overwriteEncoding?: boolean; read: any }): Promise<ResourceEncoding>
Parameters
encoding: string
options: { overwriteEncoding?: boolean; read: any }
Optional overwriteEncoding?: boolean
read:function
- read(length: number): Promise<Uint8Array>
Parameters
Returns Promise<Uint8Array>