{"id":17962715,"url":"https://github.com/fgribreau/node-truncate","last_synced_at":"2025-04-07T05:10:51.872Z","repository":{"id":7867982,"uuid":"9240411","full_name":"FGRibreau/node-truncate","owner":"FGRibreau","description":":octopus: Truncate text and keeps urls safe.","archived":false,"fork":false,"pushed_at":"2023-05-22T19:19:46.000Z","size":292,"stargazers_count":53,"open_issues_count":4,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-30T21:12:49.249Z","etag":null,"topics":["javascript","truncate","truncate-html"],"latest_commit_sha":null,"homepage":"https://twitter.com/FGRibreau","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FGRibreau.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":null,"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},"funding":{"github":"fgribreau"}},"created_at":"2013-04-05T12:09:25.000Z","updated_at":"2024-05-31T10:53:36.000Z","dependencies_parsed_at":"2024-06-18T13:43:28.150Z","dependency_job_id":"21749d22-b613-41c8-b9e5-d9df65b0813b","html_url":"https://github.com/FGRibreau/node-truncate","commit_stats":{"total_commits":48,"total_committers":8,"mean_commits":6.0,"dds":0.25,"last_synced_commit":"1c739203afb90b1f0d2582fb403883ce03184676"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FGRibreau%2Fnode-truncate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FGRibreau%2Fnode-truncate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FGRibreau%2Fnode-truncate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FGRibreau%2Fnode-truncate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FGRibreau","download_url":"https://codeload.github.com/FGRibreau/node-truncate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247595335,"owners_count":20963943,"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":["javascript","truncate","truncate-html"],"created_at":"2024-10-29T11:20:22.952Z","updated_at":"2025-04-07T05:10:51.849Z","avatar_url":"https://github.com/FGRibreau.png","language":"JavaScript","funding_links":["https://github.com/sponsors/fgribreau","https://paypal.me/fgribreau"],"categories":[],"sub_categories":[],"readme":"Truncate\n==================\n\n[![CI](https://github.com/FGRibreau/node-truncate/actions/workflows/ci.yaml/badge.svg)](https://github.com/FGRibreau/node-truncate/actions/workflows/ci.yaml) [![Downloads](http://img.shields.io/npm/dm/truncate.svg)](https://www.npmjs.com/package/truncate) [![available-for-advisory](https://img.shields.io/badge/available%20for%20consulting%20advisory-yes-ff69b4.svg?)](http://bit.ly/2c7uFJq) [![Twitter Follow](https://img.shields.io/twitter/follow/fgribreau.svg?style=flat)](https://twitter.com/FGRibreau) [![Get help on Codementor](https://cdn.codementor.io/badges/get_help_github.svg)](https://www.codementor.io/francois-guillaume-ribreau?utm_source=github\u0026utm_medium=button\u0026utm_term=francois-guillaume-ribreau\u0026utm_campaign=github) [![Slack](https://img.shields.io/badge/Slack-Join%20our%20tech%20community-17202A?logo=slack)](https://join.slack.com/t/fgribreau/shared_invite/zt-edpjwt2t-Zh39mDUMNQ0QOr9qOj~jrg)\n\nTruncate text and keeps urls safe.\n\n## NPM\nInstall the module with: `npm install truncate`\n\n## ❤️ Shameless plug\n\n- [Open-Source self-hostable or fully-managed **webhook as a service**](https://www.hook0.com/)\n- [**Charts, simple as a URL**. No more server-side rendering pain, 1 url = 1 chart](https://image-charts.com)\n- [Looking for a managed Keycloak IAM ?](https://www.cloud-iam.com/)\n\n## Usage\n\n```javascript\n// Browser\nString.truncate(\"1234 http://google.com hey :)\", 2) === \"12…\"\n```\n\n```javascript\n// NodeJS\n\u003e truncate = require('truncate');\n\u003e truncate(\"1234 http://google.com hey :)\", 4);\n\"1234…\"\n\u003e truncate(\"1234 http://google.com hey :)\", 4, {ellipsis:null}); // or ellipsis:''\n\"1234\"\n\u003e truncate(\"1234 http://google.com hey :)\", 6);\n\"1234 http://google.com…\"\n\u003e truncate(\"1234 http://google.com hey :)\", 100);\n\"1234 http://google.com hey :)\"\n```\n\n## [Changelog](/CHANGELOG.md)\n\n## Donate\n\nI maintain this project in my free time, if it helped you please support my work via [paypal](https://paypal.me/fgribreau) or [bitcoins](https://www.coinbase.com/fgribreau), thanks a lot!\n\n## License\nCopyright (c) 2014 Francois-Guillaume Ribreau\nLicensed under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffgribreau%2Fnode-truncate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffgribreau%2Fnode-truncate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffgribreau%2Fnode-truncate/lists"}