{"id":49816565,"url":"https://github.com/d-e-v-s-k/cuttr-js","last_synced_at":"2026-05-13T07:02:05.038Z","repository":{"id":42729850,"uuid":"284038649","full_name":"d-e-v-s-k/cuttr-js","owner":"d-e-v-s-k","description":"Cuttr is a javascript plugin that truncates multi-line text content with multiple truncation methods and custom ellipsis.","archived":false,"fork":false,"pushed_at":"2022-12-09T11:12:24.000Z","size":232,"stargazers_count":43,"open_issues_count":3,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-03-04T05:48:31.899Z","etag":null,"topics":["content","cuttr","dotdotdot","ellipsis","javascript","jquery","line","line-clamp","line-clamping","multi","multi-line-text","multiline","shorten","text","text-overflow","truncate","truncate-text","truncation"],"latest_commit_sha":null,"homepage":"https://cuttr.kulahs.de/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/d-e-v-s-k.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-31T13:05:59.000Z","updated_at":"2025-08-06T12:59:07.000Z","dependencies_parsed_at":"2023-01-25T21:01:34.929Z","dependency_job_id":null,"html_url":"https://github.com/d-e-v-s-k/cuttr-js","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/d-e-v-s-k/cuttr-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-e-v-s-k%2Fcuttr-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-e-v-s-k%2Fcuttr-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-e-v-s-k%2Fcuttr-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-e-v-s-k%2Fcuttr-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/d-e-v-s-k","download_url":"https://codeload.github.com/d-e-v-s-k/cuttr-js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-e-v-s-k%2Fcuttr-js/sbom","scorecard":{"id":315278,"data":{"date":"2025-08-11","repo":{"name":"github.com/d-e-v-s-k/cuttr-js","commit":"f2291f38fa0fb74ae311ca5c79ad42a26caaaab2"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 1/14 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU General Public License v3.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 17 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T00:03:58.703Z","repository_id":42729850,"created_at":"2025-08-18T00:03:58.703Z","updated_at":"2025-08-18T00:03:58.703Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32971672,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T06:31:55.726Z","status":"ssl_error","status_checked_at":"2026-05-13T06:31:51.336Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["content","cuttr","dotdotdot","ellipsis","javascript","jquery","line","line-clamp","line-clamping","multi","multi-line-text","multiline","shorten","text","text-overflow","truncate","truncate-text","truncation"],"created_at":"2026-05-13T07:00:56.653Z","updated_at":"2026-05-13T07:02:05.032Z","avatar_url":"https://github.com/d-e-v-s-k.png","language":"JavaScript","funding_links":["https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=K9X3RW27WJHWE\u0026source=url"],"categories":[],"sub_categories":[],"readme":"# Cuttr.js\n![preview](https://raw.githubusercontent.com/d-e-v-s-k/cuttr-js/master/examples/img/cuttr-intro.png)\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://www.npmjs.com/package/cuttr\"\u003e\n        \u003cimg src=\"https://badge.fury.io/js/cuttr.svg\" alt=\"npm\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://www.gnu.org/licenses/gpl-3.0.html\"\u003e\n        \u003cimg alt=\"License\" src=\"https://img.shields.io/badge/License-GPL-blue.svg\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://snyk.io/test/npm/cuttr/1.4.3\"\u003e\n        \u003cimg src=\"https://snyk.io/test/npm/cuttr/1.4.3/badge.svg\" alt=\"Known Vulnerabilities\" data-canonical-src=\"https://snyk.io/test/npm/cuttr/1.4.3\" style=\"max-width:100%;\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=K9X3RW27WJHWE\u0026source=url\"\u003e\n        \u003cimg alt=\"License\" src=\"https://img.shields.io/badge/donate-PayPal.me-ff69b4.svg\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003eCuttr is a zero dependency, easy to use JS / jQuery library that truncates multiple line text content (Line Clampin’) to fit within given specifications. It adds an ending string like a ellipsis (...) to indicate that there is more text available than currently visible.\u003c/p\u003e\n\n* Multiple truncation methods\n* Truncate text without breaking the HTML \u003c!-- * Option to maintain original text after truncation --\u003e\n* Custom ellipsis strings\n* Optional \"Read more\" anchor to expand original content\n\n[Demos online](https://cuttr.kulahs.de/examples.html) | [Codepen Example](https://codepen.io/herkulas/pen/xxZNXGv)\n\n---\nOverview\n- [Install](https://github.com/d-e-v-s-k/cuttr-js#install)\n- [License](https://github.com/d-e-v-s-k/cuttr-js#license)\n- [Usage](https://github.com/d-e-v-s-k/cuttr-js#usage)\n- [Options](https://github.com/d-e-v-s-k/cuttr-js#options)\n- [Methods](https://github.com/d-e-v-s-k/cuttr-js#methods)\n- [Callbacks](https://github.com/d-e-v-s-k/cuttr-js#callbacks)\n- [Examples](https://github.com/d-e-v-s-k/cuttr-js#demos--examples)\n\n## Install\n### Download\n\n- [cuttr.min.js](https://unpkg.com/cuttr@1/dist/cuttr.min.js) minified, or\n- [cuttr.js](https://unpkg.com/cuttr@1/dist/cuttr.js) un-minified\n\n\n### CDN\n\nLink directly to Cuttr files on [unpkg](https://unpkg.com/cuttr).\n\n``` html\n\u003cscript src=\"https://unpkg.com/cuttr@1/dist/cuttr.min.js\"\u003e\u003c/script\u003e\n\u003c!-- or --\u003e\n\u003cscript src=\"https://unpkg.com/cuttr@1/dist/cuttr.js\"\u003e\u003c/script\u003e\n\n```\n\nLink directly to Cuttr files on [cdnjs](https://cdnjs.com/libraries/cuttr).\n\n``` html\n\u003cscript src=\"https://cdnjs.cloudflare.com/ajax/libs/cuttr/1.4.3/cuttr.min.js\"\u003e\u003c/script\u003e\n\u003c!-- or --\u003e\n\u003cscript src=\"https://cdnjs.cloudflare.com/ajax/libs/cuttr/1.4.3/cuttr.js\"\u003e\u003c/script\u003e\n\n```\n\n### Package managers\nnpm\n\n```sh\nnpm install cuttr -D\n```\n\nyarn\n\n```sh\nyarn add cuttr -D\n```\n\nbower\n\n```sh\nbower install d-e-v-s-k/cuttr-js --save\n```\n\u003c!--\nyarn\n\n```sh\nyarn add cuttr\n```\n--\u003e\n\n## License\n\n### Commercial license\n\nIf you want to use Cuttr to develop commercial sites, themes, projects, and applications, the Commercial license is the appropriate license. With this option, your source code is kept proprietary. [[Purchase a Cuttr Commercial License]](https://cuttr.kulahs.de)\n\n### Open source license\n\nIf you are creating an open source application under a license compatible with the [GNU GPL license v3](https://www.gnu.org/licenses/gpl-3.0.html), you may use Cuttr under the terms of the GPLv3.  \n\nThe credit comments in the JavaScript files should be kept intact (even after combination or minification).\n\n[Read more about Cuttr's licenses](https://cuttr.kulahs.de/pricing.html).\n\n## Usage\nAs you can see in the example files, you will need to include:\n - The JavaScript file `cuttr.js` (or its minified version `cuttr.min.js`)\n\n### Including files:\n```html\n\u003cscript type=\"text/javascript\" src=\"cuttr.js\"\u003e\u003c/script\u003e\n```\nOr as a module\n```sh\nimport Cuttr from 'Cuttr';\n```\n\n### Initialization\n\n#### Initialization with Vanilla Javascript\nAll you need to do is call cuttr.js before the closing `\u003c/body\u003e` tag.\n\n```javascript\nnew Cuttr('.element', {\n    //options here\n    truncate: 'words',\n    length: 12\n});\n```\n\n#### Initialization with jQuery\nYou can use cuttr.js also as a jQuery plugin if you want to!\n\n```javascript\n$(document).ready(function() {\n    $('.element').Cuttr({\n        //options here\n        truncate: 'words',\n        length: 12\n    });\n});\n```\n\n### Options\n\n```javascript\nlet truncateElement = new Cuttr( '.container', {\n    // DEFAULTS LISTED\n\n    licenseKey: 'YOUR_KEY_HERE',\n    // this option is compulsory \n    // use the license key provided on the purchase of the Cuttr Commercial License\n    // if your project is open source and it is compatible with the GPLv3 license you can request a license key\n    // please read more about licenses here https://github.com/d-e-v-s-k/cuttr-js#license\n    \n    truncate: 'characters',\n    // Truncate method\n    // How to truncate the text\n    // ['characters'|'words'|'sentences']\n    \n    length: 100,\n    // Truncation limit\n    // After how much [characters|words|sentences] should the text be truncated\n    // note: character truncation also counts html characters\n    \n    ending: '...',\n    // Truncation ending string\n    \n    loadedClass: 'cuttr--loaded',\n    // Class to set on truncated element when truncation finished\n\n    title: false,\n    // add original, full content to elements title attribute\n    // [true|false]\n    \n    readMore: false,\n    // enables / disables the \"read more\" button\n    // [true|false]\n    \n    readMoreText: 'Read more',\n    // text to show as \"Read more\" button to show full content\n    \n    readLessText: 'Read less',\n    // text to show as \"Read less\" button to show truncated content\n    \n    readMoreBtnPosition: 'after',\n    // \"Read more\" button position\n    // ['after'|'inside']\n    // 'after' = button will be appended after the truncated element\n    // 'inside' = button will be appended inside the truncated element, at the end of the truncated content\n    \n    readMoreBtnTag: 'button',\n    // \"Read-more\" button HTML tag\n    //  ['button'|'a'|...]\n    \n    readMoreBtnSelectorClass: 'cuttr__readmore',\n    // \"Read-more\" button class selector\n    \n    readMoreBtnAdditionalClasses: '',\n    // \"Read-more\" button additional classes to be added\n})\n```\n\n### Methods\nEach plugin instance comes with some public methods to call.  See them in action inside the examples folder at methods.html.\n\nExample Initialization:\n\n```javascript\nlet truncateElement = new Cuttr('.element', {\n    //options here\n    truncate: 'words',\n    length: 12\n});\n```\n\nAfter the plugin is fired, a series of methods are available.\n\n#### expandContent()\nExpands the given instance content.\n\n```javascript\ntruncateElement.expandContent();\n```\n\n#### truncateContent()\nTruncates the given instance content.\n\n```javascript\ntruncateElement.truncateContent();\n```\n\n#### destroy()\nCompletely restores the Element to its pre-init state.\n\n```javascript\ntruncateElement.destroy();\n```\n\n#### Method usage with jQuery\nIn order to access the public methods via jQuery, you need to do it through jQuery's .data() function.\n\nExample:\n\n```javascript\n$(document).ready(function() {\n    \n    //  Cuttr initialization\n    let truncateElement = $('.element').Cuttr({\n        //options here\n        truncate: 'words',\n        length: 12\n    });\n\n    //  access html element's prototype via jQuery's .data()\n    let truncData = truncateElement.data('Cuttr');\n    //  call Cuttr method\n    truncData.expandContent();\n    \n});\n```\n\n### Callbacks\nEach plugin instance provides some callbacks. See them in action inside the examples folder at callbacks.html.\n\nAt plugin initialization, a series of callbacks are available:\n\n#### afterTruncate()\nCallback fired once the original content has been truncated.\n\n```javascript\nlet truncateElement = new Cuttr('.element', {\n    //options here\n    truncate: 'words',\n    length: 12,\n    \n    //  callbacks\n    afterTruncate: function(){\n        let truncateElement = this;\n        console.log(this);\n        alert('\"afterTruncate\" callback fired!');\n    }\n});\n```\n\n#### afterExpand()\nCallback fired once the original content has been expanded.\n\n```javascript\nlet truncateElement = new Cuttr('.element', {\n    //options here\n    truncate: 'words',\n    length: 12,\n    \n    //  callbacks\n    afterExpand: function(){\n        let truncateElement = this;\n        console.log(this);\n        alert('\"afterExpand\" callback fired!');\n    }\n});\n```\n\n## Demos \u0026 Examples\n\n[Checkout our demos \u0026 examples page](https://cuttr.kulahs.de/examples.html)\n\nMore examples on Codepen:\n* [vanilla Javascript example](https://codepen.io/herkulas/pen/oNLPXgy)\n* [Vue.js example](https://codepen.io/herkulas/pen/bGqmNeV)\n* [jQuery example](https://codepen.io/herkulas/pen/QWNwmRr)\n\n## Development\nThis project uses [Gulp (v4)](http://gulpjs.com/) to minify the JS file.\nIf you are unfamiliar with Gulp, check [this tutorial](https://travismaynard.com/writing/getting-started-with-gulp) on how to get started.\u003cbr /\u003e\nRun `gulp` in the command-line to put out a build on the files.\n\n## Browser support\nThe Cuttr javascript / jQuery string truncation plugin targets modern browsers that support ES5, meaning Internet Explorer 10 and earlier are not supported, but with IE11 and above you are fine.\n\n---\n\nCreated and maintained by [DEVSK](https://github.com/d-e-v-s-k).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd-e-v-s-k%2Fcuttr-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fd-e-v-s-k%2Fcuttr-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd-e-v-s-k%2Fcuttr-js/lists"}