@sensorfactdev/ellipsisify

1.0.0 • Public • Published

logo

ellipsisify

npm version Build Status Coverage Status

Add ellipses to strings in JavaScript

An ellipsis (plural ellipses; from the Ancient Greek: ἔλλειψις, élleipsis, 'omission' or 'falling short') is a series of dots (typically three, such as "…") that usually indicates an intentional omission of a word, sentence, or whole section from a text without altering its original meaning

Usage

ellipsis at the end

Cutting of strings on provided length and adding ellipsis.

const ellipsisify = require('@sensorfactdev/ellipsisify');
const ellipsisified = ellipsisify('short string', 10);
// => 'short stri...'

const ellipsisifiedWithCustomChars = ellipsisify('short string', 10, null, '…');
// => 'short stri…'

ellipsis in a string

Cutting of strings on provided length.

const ellipsisify = require('@sensorfactdev/ellipsisify');
const ellipsisified = ellipsisify('longer string with ending', 10, 5)
// => 'longer str...nding'

Other resources

/@sensorfactdev/ellipsisify/

    Package Sidebar

    Install

    npm i @sensorfactdev/ellipsisify

    Weekly Downloads

    22

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    232 kB

    Total Files

    7

    Last publish

    Collaborators

    • davidmoller
    • daniel.sensorfact
    • thomas.molina.sensorfact
    • chung225
    • rui.loureiro
    • silikerbil
    • rodrigo_ss
    • tinakuzmenko_sensorfact
    • manonww
    • sabina.tursunkhanova
    • wellett-sensorfact
    • merlinde.wobben
    • sfdgamboa
    • thijssensorfact
    • iskren_sensorfact
    • paco.trujillo
    • avladd
    • hector.sensorfact
    • kiliangrashoff
    • karimcitoh
    • zoiderberg_nl