Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Get a Text Message's size depending on it's content.
Get it's encoding and which characters are not GSM-7 compatible.
Internally, we're using the following awesome resources:

Install

npm install @setkeeper/text-message-utils

or

yarn add @setkeeper/text-message-utils

Usage

import { getMessageSegmentInformation } from 'text-message-utils'

const dataUCS2 = `
Hi Michael!
Please be sure to be ready tomorrow morning 5am 🚀
See you tomorrow!
`

getMessageSegmentInformation(dataUCS2)
// returns: { count: 2, encoding: 'UCS-2', nonGSM7Characters: ['🚀'] }

const dataGSM7 = `
Hi Michael!
Please be sure to be ready tomorrow morning 5am
See you tomorrow!
`

getMessageSegmentInformation(dataGSM7)
// returns: { count: 1, encoding: 'GSM-7', nonGSM7Characters: [] }

Publish a new version

npm run build
npm publish --access public

License

(c) 2021 Hugo Cordier. MIT License

About

Get a Text Message's size depending on it's content.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages