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

truncate

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

truncate - npm Package Compare versions

Comparing version 2.0.1 to 2.1.0

truncate.d.ts

17

CHANGELOG.md
# Change Log
## [Unreleased](https://github.com/fgribreau/node-truncate/tree/HEAD)
[Full Changelog](https://github.com/fgribreau/node-truncate/compare/v2.0.0...HEAD)
**Implemented enhancements:**
- Support HTML suffix [\#4](https://github.com/FGRibreau/node-truncate/issues/4)
**Merged pull requests:**
- Fix redos [\#6](https://github.com/FGRibreau/node-truncate/pull/6) ([davisjam](https://github.com/davisjam))
- Update all dependencies 🌴 [\#5](https://github.com/FGRibreau/node-truncate/pull/5) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
## [v2.0.0](https://github.com/fgribreau/node-truncate/tree/v2.0.0) (2015-09-17)
[Full Changelog](https://github.com/fgribreau/node-truncate/compare/v1.0.5...v2.0.0)

@@ -12,3 +24,2 @@

## [v1.0.5](https://github.com/fgribreau/node-truncate/tree/v1.0.5) (2015-07-26)
[Full Changelog](https://github.com/fgribreau/node-truncate/compare/v1.0.4...v1.0.5)

@@ -21,3 +32,2 @@

## [v1.0.4](https://github.com/fgribreau/node-truncate/tree/v1.0.4) (2014-10-22)
[Full Changelog](https://github.com/fgribreau/node-truncate/compare/v1.0.3...v1.0.4)

@@ -28,3 +38,2 @@

\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*

@@ -5,4 +5,5 @@ {

"main": "truncate.js",
"types": "truncate.d.ts",
"description": "Truncate text and keep urls safe",
"version": "2.0.1",
"version": "2.1.0",
"homepage": "https://github.com/FGRibreau/node-truncate",

@@ -9,0 +10,0 @@ "repository": {

@@ -1,4 +0,6 @@

Truncate [![CircleCI](https://img.shields.io/circleci/project/github/FGRibreau/node-truncate.svg)]() [![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&utm_medium=button&utm_term=francois-guillaume-ribreau&utm_campaign=github)
Truncate
==================
[![CircleCI](https://img.shields.io/circleci/project/github/FGRibreau/node-truncate.svg)]() [![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&utm_medium=button&utm_term=francois-guillaume-ribreau&utm_campaign=github)
Truncate text and keeps urls safe.

@@ -13,3 +15,3 @@

// Browser
String.truncate("1234 http://google.com hey :)", 2) === "12..."
String.truncate("1234 http://google.com hey :)", 2) === "12…"
```

@@ -21,7 +23,7 @@

> truncate("1234 http://google.com hey :)", 4);
"1234..."
"1234…"
> truncate("1234 http://google.com hey :)", 4, {ellipsis:null}); // or ellipsis:''
"1234"
> truncate("1234 http://google.com hey :)", 6);
"1234 http://google.com..."
"1234 http://google.com…"
> truncate("1234 http://google.com hey :)", 100);

@@ -28,0 +30,0 @@ "1234 http://google.com hey :)"

@@ -28,3 +28,2 @@ /*global module:true*/

* @param {Object} options (optional)
* @param {Boolean} [options.keepImageTag] flag to specify if keep image tag, false by default
* @param {Boolean|String} [options.ellipsis] omission symbol for truncated string, '...' by default

@@ -31,0 +30,0 @@ * @return {String} truncated string

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