strip-bom-buf

Strip UTF-8 byte order mark (BOM) from a Uint8Array

MIT 5 个版本
安装
npm install strip-bom-buf
yarn add strip-bom-buf
pnpm add strip-bom-buf
bun add strip-bom-buf
README

strip-bom-buf

Strip UTF-8 byte order mark (BOM) from a Uint8Array

From Wikipedia:

The Unicode Standard permits the BOM in UTF-8, but does not require nor recommend its use. Byte order has no meaning in UTF-8.

Install

npm install strip-bom-buf

Usage

import fs from 'node:fs';
import stripBomBuffer from 'strip-bom-buf';

stripBomBuffer(fs.readFileSync('unicorn.txt'));
//=> 'unicorn'
版本列表
4.0.0 2023-10-24
3.0.1 2021-09-02
3.0.0 2021-08-15
2.0.0 2019-04-28
1.0.0 2016-04-30