has-bom-string

Returns true if string has a byte order mark (BOM)

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
has-bom-string
101.0.08 years ago8 years agoMinified + gzip package size for has-bom-string in KB

Readme

Returns true if string has a byte order mark (BOM)

!code climatecodeclimate-imgcodeclimate-url !standard code stylestandard-imgstandard-url !travis build statustravis-imgtravis-url !coverage statuscoveralls-imgcoveralls-url !dependency statusdavid-imgdavid-url

Install

npm i has-bom-string --save

Usage

For more use-cases see the tests

var hasBomString = require('has-bom-string')

hasBomString('\ufefffoo')
// => true

hasBomString('foo')
// => false
hasBomString(new Buffer('\ufefffoo'))
// => false
hasBomString(new Buffer('foo'))
// => false

Related

  • has-bom: Returns true if a buffer or string has a byte order mark (BOM)
  • is-buffer: Determine if an object is Buffer
  • strip-bom: Strip UTF-8 byte order mark (BOM) from a string/buffer
  • strip-bom-buffer: Strip a byte order mark (BOM) from a buffer.
  • strip-bom-string: Strip a byte order mark (BOM) from a string.

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
But before doing anything, please read the CONTRIBUTING.md guidelines.

Charlike Make Reagent !new message to charlikenew-message-imgnew-message-url !freenode #charlikefreenode-imgfreenode-url

!tunnckocore.tkauthor-www-imgauthor-www-url !keybase tunnckocorekeybase-imgkeybase-url !tunnckoCore npmauthor-npm-imgauthor-npm-url !tunnckoCore twitterauthor-twitter-imgauthor-twitter-url !tunnckoCore githubauthor-github-imgauthor-github-url