Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sindresorhus/strip-bom
Strip UTF-8 byte order mark (BOM) from a string
https://github.com/sindresorhus/strip-bom
Last synced: 4 days ago
JSON representation
Strip UTF-8 byte order mark (BOM) from a string
- Host: GitHub
- URL: https://github.com/sindresorhus/strip-bom
- Owner: sindresorhus
- License: mit
- Created: 2014-04-04T16:21:00.000Z (over 10 years ago)
- Default Branch: main
- Last Pushed: 2021-04-16T18:54:24.000Z (over 3 years ago)
- Last Synced: 2024-10-29T22:38:31.982Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 25.4 KB
- Stars: 111
- Watchers: 8
- Forks: 21
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Funding: .github/funding.yml
- License: license
- Security: .github/security.md
Awesome Lists containing this project
- awesome-nodejs-cn - strip-bom - 从字符串 / Buffer / Stream中解除 UTF-8 BOM 问题 (包 / 其他)
- awesome-nodejs - strip-bom - Strip UTF-8 byte order mark (BOM) from a string. (Repository / Text/String)
- awesome-nodejs-cn - strip-bom - **star:111** 从字符串/缓冲区/流中剥离UTF-8字节顺序标记(BOM) (包 / 杂项)
- awesome-nodejs - strip-bom - Strip UTF-8 byte order mark (BOM) from a string/buffer/stream. (Packages / Miscellaneous)
- awesome-nodejs - strip-bom - Strip UTF-8 byte order mark (BOM) from a string - ★ 68 (Miscellaneous)
- awesome-node - strip-bom - Strip UTF-8 byte order mark (BOM) from a string/buffer/stream. (Packages / Miscellaneous)
README
# strip-bom
> Strip UTF-8 [byte order mark](https://en.wikipedia.org/wiki/Byte_order_mark#UTF-8) (BOM) from a string
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
```## Usage
```js
import stripBom from 'strip-bom';stripBom('\uFEFFunicorn');
//=> 'unicorn'
```## Related
- [strip-bom-cli](https://github.com/sindresorhus/strip-bom-cli) - CLI for this module
- [strip-bom-buf](https://github.com/sindresorhus/strip-bom-buf) - Buffer version of this module
- [strip-bom-stream](https://github.com/sindresorhus/strip-bom-stream) - Stream version of this module---
Get professional support for 'strip-bom' with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.