ellipsisify

    0.1.1 • Public • Published

    ellipsisify

    build status coverage status

    Demo:

    Please refer this pen to see it in action or to play around.

    Usage:

    NodeJS

    var ellipsisify = require('path/to/ellipsisify');
    console.log(ellipsisify.center('abcdefghij', 8)); // abc...ij
    console.log(ellipsisify.left('abcdefghij', 8)); // ...fghij
    console.log(ellipsisify.right('abcdefghij', 8)); // abcde...

    Browser

    <html>
      ...
        <script src="path/to/ellipsisify.js"></script> 
      ...
      <script>
        console.log(ellipsisify.center('abcdefghij', 8)); // abc...ij
        console.log(ellipsisify.left('abcdefghij', 8)); // ...fghij
        console.log(ellipsisify.right('abcdefghij', 8)); // abcde...
      </script> 
    </html>

    API

    ellipsisify.center(string, threshold);
    ellipsisify.left(string, threshold);
    ellipsisify.right(string, threshold);

    License

    Copyright (c) 2015, Yahoo! Inc. Copyrights licensed under the MIT License. See the accompanying LICENSE file for terms.

    Install

    npm i ellipsisify

    DownloadsWeekly Downloads

    2

    Version

    0.1.1

    License

    MIT

    Last publish

    Collaborators

    • sarbbottam