text-ellipsis
Cut a string if too long
Last updated 11 years ago by chtefi .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install text-ellipsis 
SYNC missed versions from official npm registry.

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"

Current Tags

  • 1.0.3                                ...           latest (11 years ago)

3 Versions

  • 1.0.3                                ...           11 years ago
  • 1.0.2                                ...           11 years ago
  • 1.0.1                                ...           11 years ago
Maintainers (1)
Downloads
Total 2
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (0)
None
Dev Dependencies (9)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE