get-4byte-chars

0.1.0 • Public • Published

get-4byte-chars

NPM version Bower version Build Status Coverage Status dependencies Status devDependencies Status

Get all 4-byte characters form a string

get4byteChars('I 💓 🍣.'); //=> ['💓', '🍣']

Installation

npm

npm install get-4byte-chars

bower

bower install get-4byte-chars

API

get4byteChars(str [, option])

str: String
option: Object
Return: Boolean

It detects characters that costs 4 bytes in UTF-8 from a given string, and returns them as an array.

option.unique

Type: Boolean
Default: true

Omit all duplicated characters from result.

get4byteChars('🌊🌊 \😺/ 🌊🌊');
//=> ['🌊']
 
get4byteChars('🌊🌊 \😺/ 🌊🌊', {unique: false});
//=> ['🌊', '🌊', '🌊', '🌊']

License

Copyright (c) 2016 Shinnosuke Watanabe

Licensed under the MIT License.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.0
    641
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.0
    641
  • 0.0.5
    0
  • 0.0.3
    0
  • 0.0.2
    0
  • 0.0.1
    0

Package Sidebar

Install

npm i get-4byte-chars

Weekly Downloads

641

Version

0.1.0

License

MIT

Last publish

Collaborators

  • shinnn