Skip to content

Latest commit

 

History

History
69 lines (58 loc) · 2.54 KB

README.md

File metadata and controls

69 lines (58 loc) · 2.54 KB

ellipsed

license   GitHub forks GitHub stars
npm version npm npm   Demo
contributions welcome

What is Ellipsed?

Ellipsed is a JavaScript plugin for generating multi-lined ellipsed text. It provides the ability to specify the number of lines visible.

Demo

You can see the example here: https://nzambello.github.io/ellipsed/

The example/ directory of this repo contains the demo showed above. To start it on your local machine, clone the repository and install it by following the installation instructions below, then start it with npm start (or with yarn start).

Install

# Yarn
yarn add ellipsed

# NPM
npm install --save ellipsed

# Bower
bower install ellipsed

Usage

Ellipsed provides a function that is used like this:

ellipsis(selector, rows);

Settings

Option Type Description
selector string CSS selector used to target the element
rows int Number of rows that should be visible, following words will be trucated with ...

Import

Ellipsed is provided as a UMD module.

You can use it as a ES6 module:

import { ellipsis } from 'ellipsed';

As a CommonJS module:

var { ellipsis } = require('ellipsed');

As an AMD module:

require([
  'ellipsed'
], function(ellipsed) {
  var ellipsis = ellipsed.ellipsis;
});

Or as a global module in the browser:

var ellipsis = window.ellipsed.ellipsis;

Contributing

New contributors are warmly welcome, see the CONTRIBUTING.md file for other information.