Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

html-truncate

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

html-truncate

truncate html text and keep tag safe

  • 0.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
19K
increased by21.1%
Maintainers
1
Weekly downloads
 
Created
Source

motivation

To create a library ease to truncate HTML text and keep tag safe

example

var string = '<p><div>hello world</div></p>';

truncate(string, 5) =======> '<p><div>hello</div></p>'

output HTML

hello

string = '<p><div>Do you <b>think</b> it is useful</div></p>';

truncate(string, 10) =======> '<p><div>Do you <b>thi</b></div></p>'

output HTML

Do you thi

demo

./demo

npm package

npm install html-truncate

FAQs

Package last updated on 03 Feb 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc