{"id":18103186,"url":"https://github.com/averagemarcus/truncatise","last_synced_at":"2025-04-13T19:09:47.983Z","repository":{"id":11494596,"uuid":"13969771","full_name":"AverageMarcus/Truncatise","owner":"AverageMarcus","description":"Provides the ability to truncate HTML strings down to excerpts based on character length, word length or paragraph length.","archived":false,"fork":false,"pushed_at":"2019-06-12T18:47:42.000Z","size":14,"stargazers_count":17,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T09:46:23.734Z","etag":null,"topics":["hacktoberfest"],"latest_commit_sha":null,"homepage":"https://npmjs.org/package/truncatise","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/AverageMarcus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-10-29T21:45:57.000Z","updated_at":"2022-03-27T05:41:12.000Z","dependencies_parsed_at":"2022-09-26T17:50:17.517Z","dependency_job_id":null,"html_url":"https://github.com/AverageMarcus/Truncatise","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AverageMarcus%2FTruncatise","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AverageMarcus%2FTruncatise/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AverageMarcus%2FTruncatise/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AverageMarcus%2FTruncatise/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AverageMarcus","download_url":"https://codeload.github.com/AverageMarcus/Truncatise/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248766736,"owners_count":21158301,"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":["hacktoberfest"],"created_at":"2024-10-31T22:10:51.159Z","updated_at":"2025-04-13T19:09:47.962Z","avatar_url":"https://github.com/AverageMarcus.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Truncatise\n## JavaScript module to truncate HTML strings.\n\n### Description\nProvides the ability to truncate HTML strings down to excerpts based on character length, word length or paragraph length.\n\n**Features:**\n*\tTruncate based on number of Characters, Words or Paragraphs.\n*\tStrip HTML from returned string.\n*\tProvides a strict flag to specify whether to cut-off mid word or not.\n*\tConfigurable suffix appended to the end of the returned excerpt.\n\n### Install\n  npm install truncatise\n\n### Options (with default values)\n\n```javascript\n{\n  TruncateBy:     'words',  // Options are 'words', 'characters' or 'paragraphs'\n  TruncateLength: 50,    \t  // The count to be used with TruncatedBy\n  StripHTML:      false,    // Whether or not the truncated text should contain HTML tags\n  Strict:         true,     // If set to false the truncated text finish at the end of the word\n  Suffix:         '...'     // Text to be appended to the end of the truncated text\n}\n```\n\n### Example Usage\n\n```javascript\nvar options = {\n  TruncateLength: 4,\n  TruncateBy : \"words\",\n  Strict : false,\n  StripHTML : true,\n  Suffix : ' (Read More)'\n};\nvar excerpt = truncatise(\"\u003cp\u003eThis is a test of Truncatise\u003c/p\u003e\", options);\nconsole.log(excerpt); // This is a test (Read More)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faveragemarcus%2Ftruncatise","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faveragemarcus%2Ftruncatise","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faveragemarcus%2Ftruncatise/lists"}