How to use the just-truncate function in just-truncate

To help you get started, we’ve selected a few just-truncate examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ritz078 / embed-js / packages / embed-plugin-utilities / src / with-details-template.js View on Github external
export default function(
  { url, title, embedUrl, description, thumbnail },
  thumbClassName,
  showPlayIcon = false
) {
return `<div class="ejs-preview ejs-embed"><div style="background-image:url(${thumbnail})" data-url="${embedUrl}" class="ejs-thumb ${thumbClassName}">${showPlayIcon ? '<span>►</span>' : ''}</div><div class="ejs-info"><h4 class="ejs-title"><a href="${url}">${title}</a></h4><div class="ejs-desc">${truncate(
    description,
    150
  )}</div></div></div>`
}

just-truncate

truncate a string with a custom suffix

MIT
Latest version published 2 years ago

Package Health Score

56 / 100
Full package analysis

Popular just-truncate functions