# strip-bom-buf

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

Latest version **4.0.0** (published 2023-10-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install strip-bom-buf
pnpm add strip-bom-buf
yarn add strip-bom-buf
bun add strip-bom-buf
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.0 |
| Published | 2023-10-24 |
| First published | 2016-04-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=18 |
| Dependencies | 2 |
| Unpacked size | 3.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 21 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | strip, bom, byte, order, mark, unicode, utf8, utf-8, remove, delete, trim, text, buffer, uint8array |

## Links

- npm: https://www.npmjs.com/package/strip-bom-buf
- Repository: https://github.com/sindresorhus/strip-bom-buf
- Homepage: https://github.com/sindresorhus/strip-bom-buf#readme
- Issues: https://github.com/sindresorhus/strip-bom-buf/issues
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/strip-bom-buf

## Dependencies (2)

- [is-utf8](https://npm.io/package/is-utf8.md) ^0.2.1
- [uint8array-extras](https://npm.io/package/uint8array-extras.md) ^0.3.0

## Alternatives

- [@mdxeditor/editor](https://npm.io/package/@mdxeditor/editor.md) — 962.4K weekly downloads
- [mmdb-lib](https://npm.io/package/mmdb-lib.md) — 680.9K weekly downloads
- [playcanvas](https://npm.io/package/playcanvas.md) — 36.2K weekly downloads
- [@glw907/cairn-cms](https://npm.io/package/@glw907/cairn-cms.md) — 967 weekly downloads
- [markdown-to-confluence](https://npm.io/package/markdown-to-confluence.md) — 103 weekly downloads

## Recent versions

- 4.0.0 (latest) — 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

## README

# strip-bom-buf

> Strip UTF-8 [byte order mark](http://en.wikipedia.org/wiki/Byte_order_mark#UTF-8) (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

```sh
npm install strip-bom-buf
```

## Usage

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

stripBomBuffer(fs.readFileSync('unicorn.txt'));
//=> 'unicorn'
```

## Related

- [strip-bom](https://github.com/sindresorhus/strip-bom) - String version of this module
- [strip-bom-stream](https://github.com/sindresorhus/strip-bom-stream) - Stream version of this module

---
_Source: https://npm.io/package/strip-bom-buf · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
