1.0.3 • Published 9 years ago

text-ellipsis v1.0.3

Weekly downloads
3,914
License
MIT
Repository
github
Last release
9 years ago

text-ellipsis Build Status

Cut off a string if too long

Why

You always want to cut long strings.

Install

$ npm install --save text-ellipsis

Usage

var ellipsis = require('text-ellipsis');

var short = ellipsis('a very long text', 10);
console.log(short);
// "a very ..."

var short = ellipsis('a very long text', 10, { side: 'start' });
console.log(short);
// "...ng text"

var short = ellipsis('a very long text', 10, { ellipsis: ' END' });
console.log(short);
// "a very END"