Socket
Book a DemoInstallSign in
Socket

twitter-text-tweetlength-js

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

twitter-text-tweetlength-js

subset of official twitter-text library dedicated to counting tweet length

latest
Source
npmnpm
Version
1.14.3
Version published
Maintainers
1
Created
Source

Build Status npm Bower

twitter-text-tweetlength-js

This library is a subset of official twitter-text library dedicated to counting tweet length. Autolinking, extraction and other officially-implemented features were all removed.

NPM Users

Install it with: npm install twitter-text-tweetlength-js

Usage

The twttr.txt namespace is exported, making it available as such:

Tweet character count example

var twitter = require('twitter-text-tweetlength-js');
twitter.getTweetLength('test.com'); // => 23

getTweetLength returns the computed length of a tweet after taking into consideration t.co URL shortening and non UTF-16 characters

Remaining character count example

var tweet = "This is a test tweet";
var remainingCharacters = 140 - twttr.txt.getTweetLength(tweet);

FAQs

Package last updated on 10 Jan 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts