@fiquu/shorten
Version:
Shortens a string (truncate) optionally keeping whole words.
29 lines (19 loc) • 852 B
Markdown
# @fiquu/shorten
[](https://travis-ci.org/fiquu/shorten)




Dependency-free and configurable tool to shorten (truncate) a string keeping whole words by default.
## Installation
```sh
npm i @fiquu/shorten
```
## Usage
```ts
import shorten from `@fiquu/shorten`;
const short = shorten('Some long string to shorten with many possible words to split into.');
// 'Some long string to shorten with many possible...'
```
## Documentation
See [the documentaion page](https://fiquu.github.io/shorten/) for more info and options.