Skip to content

Utility to understand how many sms will be required to send a text string. Largely inspired by sms-counter

License

Notifications You must be signed in to change notification settings

inkOfPixel/sms-length

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sms-length 💌 📏

A simple utility function to understand how many sms will be required to send a text message via SMS. Largely inspired by sms-counter.

Installation

npm install sms-length

yarn add sms-length

Usage

import { count } from "sms-length";

count("This is a simple text message");

/*

Returns: {
  encoding: "GSM_7BIT",
  length: 29,
  characterPerMessage: 160,
  inCurrentMessage: 29,
  remaining: 131,
  messages: 1,
}

*/

Thanks to

https://github.com/danxexe/sms-counter

About

Utility to understand how many sms will be required to send a text string. Largely inspired by sms-counter

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •