Skip to content

sderosiaux/text-ellipsis

Repository files navigation

text-ellipsis Build Status

Cut off a string if too long

Why

You always want to cut off 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"

Releases

No releases published

Packages

No packages published