{"id":19617792,"url":"https://github.com/nzambello/ellipsed","last_synced_at":"2025-04-04T15:06:20.630Z","repository":{"id":41384208,"uuid":"95038543","full_name":"nzambello/ellipsed","owner":"nzambello","description":"A JavaScript library for multilined ellipsis","archived":false,"fork":false,"pushed_at":"2023-03-04T03:27:16.000Z","size":1156,"stargazers_count":267,"open_issues_count":5,"forks_count":20,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-26T15:01:54.247Z","etag":null,"topics":["ellipsis","frontend","javascript","javascript-library","text-ellipsis"],"latest_commit_sha":null,"homepage":"https://nzambello.github.io/ellipsed/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nzambello.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-21T19:26:21.000Z","updated_at":"2024-06-18T20:04:01.089Z","dependencies_parsed_at":"2024-06-18T20:03:47.868Z","dependency_job_id":"573f3e78-9e4b-4489-9881-6b1f1b3fc9c7","html_url":"https://github.com/nzambello/ellipsed","commit_stats":{"total_commits":125,"total_committers":14,"mean_commits":8.928571428571429,"dds":0.496,"last_synced_commit":"bc8233ee323fce97a6fa38da73c1e52d295f5488"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nzambello%2Fellipsed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nzambello%2Fellipsed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nzambello%2Fellipsed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nzambello%2Fellipsed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nzambello","download_url":"https://codeload.github.com/nzambello/ellipsed/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247198445,"owners_count":20900079,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ellipsis","frontend","javascript","javascript-library","text-ellipsis"],"created_at":"2024-11-11T11:07:17.711Z","updated_at":"2025-04-04T15:06:20.612Z","avatar_url":"https://github.com/nzambello.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"[![Ellipsed](https://github.com/nzambello/ellipsed/raw/master/logo.svg?sanitize=true)](https://nzambello.github.io/ellipsed/)\n\n[![license](https://img.shields.io/github/license/nzambello/ellipsed.svg)](https://github.com/nzambello/ellipsed/blob/master/LICENSE)\u0026nbsp;\u0026nbsp;\n[![GitHub forks](https://img.shields.io/github/forks/nzambello/ellipsed.svg?style=social\u0026label=Fork)](https://github.com/nzambello/ellipsed)\n[![GitHub stars](https://img.shields.io/github/stars/nzambello/ellipsed.svg?style=social\u0026label=Star)](https://github.com/nzambello/ellipsed)  \n[![npm version](https://badge.fury.io/js/ellipsed.svg)](https://www.npmjs.com/package/ellipsed)\n[![npm](https://img.shields.io/npm/dt/ellipsed.svg)](https://www.npmjs.com/package/ellipsed)\n[![compatibility](https://img.shields.io/badge/compatibility-tested-brightgreen.svg?style=flat)](https://github.com/nzambello/ellipsed/issues)\n  \n[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/nzambello/ellipsed/issues)\n[![Join the chat at https://gitter.im/ellipsed/Lobby](https://badges.gitter.im/ellipsed/Lobby.svg)](https://gitter.im/ellipsed/Lobby?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge) \u0026nbsp;\n[![Demo](https://img.shields.io/badge/Demo-here-yellowgreen.svg)](https://nzambello.github.io/ellipsed/)\n  \n\n## What is Ellipsed?\nEllipsed is a JavaScript library for generating multi-lined ellipsed text.  \nIndicating the number of visible lines, it will truncate the text at the correct position in targeted elements.\n  \n![Example screenshot](https://github.com/nzambello/ellipsed/blob/master/example/ellipsed.png)\n\n## Demo  \nYou can see the demo here: https://nzambello.github.io/ellipsed/\n\nThe [example/](https://github.com/nzambello/ellipsed/tree/master/example) directory of this repo contains the demo showed above.\nTo 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`).  \n\n## Install\n```sh\n# Yarn\nyarn add ellipsed\n\n# NPM\nnpm install --save ellipsed\n\n# Bower\nbower install ellipsed\n```\n\n## Usage\nCall the ellipsis method with three parameters:\n````javascript\nellipsis(selector, rows, options);\n````\n\n- `selector` - A CSS selector string or the DOM Node or Node List used to target the element for truncation\n- `rows` - An integer value used as the number of rows that should be visible, following words will be trucated with the `replaceStr` (default is `'...'`).\n- `options` - Allows an options object to be passed to further customise the functionality. See options section below for details.\n  \nIf `responsive` option is set, the function returns the ID of the listener returned by `setTimeout`. It can be useful to clear resize handler timeout.\n\n### Options\nOptions can be passed through the method using the third parameter, which provides greater control.\n\nName | Type |  Default | Description\n---- | ---- |  ------- | -----------\nreplaceStr | string | `'...'` | The string that substituted following the trucated string.\nresponsive | boolean | `false` | If true, the method is re-called on resize event, so the number of rows is preserved.\ndebounceDelay | integer | `250` | If `responsive` option is set, it's the delay value for resizing events debouncing.\ndelimiter | string | `' '` | Use '' for text written in languages such as Japanese, Chinese, etc. since there's usually no space break in such languages; or for text contains long word (word that is longer than the width of the container).\n\n### Import\nEllipsed is provided as a UMD module.\n\nYou can use it as a ES6 module:\n```javascript\nimport { ellipsis } from 'ellipsed';\n```\nAs a CommonJS module:\n```javascript\nvar { ellipsis } = require('ellipsed');\n```\nAs an AMD module:\n```javascript\nrequire([\n  'ellipsed'\n], function(ellipsed) {\n  var ellipsis = ellipsed.ellipsis;\n});\n```\nOr as a global module in the browser:\n```javascript\nvar ellipsis = window.ellipsed.ellipsis;\n```\n\n## Performance\n\nIt seems that having multiple calls of ellipsis with `responsive` option enabled would add multiple event listeners and would be recommended to use a single call with a multiple selector.\nA single event listener should be more efficient and events handling more fluid.\n\n\n## Browser support\nThe library has been tested on:\n\n- Google Chrome 60+\n- Firefox 55+\n- Safari 10+\n- Edge 14+\n- IE 9+\n \n## Contributing\nNew contributors are warmly welcome, see the [CONTRIBUTING.md](https://github.com/nzambello/ellipsed/blob/master/CONTRIBUTING.md) file for other information.\n  \nMany thanks to [@nekorina](https://github.com/nekorina) for project's logo.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnzambello%2Fellipsed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnzambello%2Fellipsed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnzambello%2Fellipsed/lists"}