0.0.7 • Published 5 months ago

text-trunc v0.0.7

Weekly downloads
-
License
ISC
Repository
github
Last release
5 months ago

Long text shortener

Installation

Use the following commands to install

# NPM
npm i txt-trunc
# YARN
yarn add txt-trunc

Usage

const textTrunc = require("text-trunc");
// OR
import textTrunc from "text-trunc";

const text = "your text";
// arguments [text, length, options?]
let truncate = textTrunc(text, 5, {});

Parameter

text: The text to be shortened

length: The number of words that are shortened and its default value is 10

options: ⬇⬇⬇⬇⬇⬇⬇

Options

options.start

The default value of this option is equal to 0 and it determines that the text to be shortened starts from the second character.

options.dots

This option determines what character or characters should be placed at the end of the shortened text The default value of this option is equal to "..." which can be set as desired

options.seperator

In this option, any value you put will be placed instead of the space between the words

License

MIT

0.0.7

5 months ago

0.0.6

5 months ago

0.0.5

6 months ago

0.0.4

6 months ago