Socket
Book a DemoInstallSign in
Socket

strip-all-bom

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

strip-all-bom

Strip all UTF-8 byte order marks (BOM) from a string

latest
Source
npmnpm
Version
2.0.1
Version published
Maintainers
1
Created
Source

strip-all-bom

This is a package that allows you to strip all UTF-8 byte order marks (BOM) from a string.

Usage

import stripAllBom from 'strip-all-bom';

stripAllBom('\uFEFF🙈\uFEFF🙉\uFEFF🙊');
//=> '🙈🙉🙊'

Install

$ npm install strip-all-bom

Why?

I used a rich text editor which added ZWNBSP (Zero Width No-Break Space, BOM) on mentions which in turn messed up the tsvector search column in a postgres db. I created this package to strip all content from BOMs before saving.

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.

Keywords

strip

FAQs

Package last updated on 31 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts