@setkeeper/text-message-utils
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Text Message Utils

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

Package Sidebar

Install

npm i @setkeeper/text-message-utils

Weekly Downloads

6

Version

1.0.0

License

MIT

Unpacked Size

28.6 kB

Total Files

12

Last publish

Collaborators

  • hugocrd