1.0.4 • Published 1 year ago

text-shortener v1.0.4

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

��# text-shortener

Description

This package is used to help shorten text/strings passed in, generate a truncated string and return the value to the users

Usage

const output = truncateText(value, length)

output: This contains the returned text value based on {value, length} that are passed into the truncateText fn

value* - required | string
length* - optional | number

Code Demonstration

//Without length option

const output = truncateText('This');

console.log(output); // Outputs 'This'

//Without length option

const output = truncateText(
  'This is a long text that is used for nothing in particular just want to show you how to use this plugin',
);

console.log(output); // Outputs 'This is a long text that is us...'

//With length option

const output = truncateText(
  'This is a long text that is used for nothing in particular just want to show you how to use this plugin',
  4,
);

console.log(output); // Outputs 'This...'

//With length option

const output = truncateText('This', 4);

console.log(output); // Outputs 'This'

Thank you

0.0.1

1 year ago

1.0.4

1 year ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.0

2 years ago