# tweet-truncate

> Chops text and urls down to size for Twitter using ellipses.

Latest version **2.0.0** (published 2018-01-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install tweet-truncate
pnpm add tweet-truncate
yarn add tweet-truncate
bun add tweet-truncate
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2018-01-14 |
| First published | 2015-02-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Jim Kang |
| Maintainers | jimkang |

## Links

- npm: https://www.npmjs.com/package/tweet-truncate
- Repository: https://github.com/jimkang/tweet-truncate
- Issues: https://github.com/jimkang/tweet-truncate/issues
- npm.io page: https://npm.io/package/tweet-truncate

## Recent versions

- 2.0.0 (latest) — 2018-01-14
- 1.1.1 — 2015-12-27
- 1.1.0 — 2015-02-26
- 1.0.0 — 2015-02-25

## README

tweet-truncate
==================

Chops text down to size for Twitter using ellipses. You give it the text and any urls you want to include in the tweet, and it gives you back something that will fit.

Installation
------------

    npm install tweet-truncate

Usage
-----

    var truncateToTweet = require('tweet-truncate');
    console.log(truncateToTweet({
      maxTweetMessageLength: 140,
      text: 'Normally, this text would not need to be truncated. However! A URL must be included in the tweet. URL stands for Universal Resource Locator.',
      urlsToAdd: [
        'http://smidgeo.com/plan'
      ]
    });

This would print out:

    Normally, this text would not need to be truncated. However! A URL must be included in the tweet. URL stands for Uni… http://smidgeo.com/plan

`maxTweetMessageLength` defaults to 280 now.

Tests
-----

Run tests with `make test`.

License
-------

MIT.

---
_Source: https://npm.io/package/tweet-truncate · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
