# truncator-js

> Truncate text to the nearest word of a limit

Latest version **0.0.4** (published 2016-11-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install truncator-js
pnpm add truncator-js
yarn add truncator-js
bun add truncator-js
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2016-11-08 |
| First published | 2016-11-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Ian Mcdonald |
| Maintainers | ianmcdonald |

## Links

- npm: https://www.npmjs.com/package/truncator-js
- Repository: https://github.com/ianmcdonald/truncator
- npm.io page: https://npm.io/package/truncator-js

## Recent versions

- 0.0.4 (latest) — 2016-11-08
- 0.0.3 — 2016-11-08

## README

# truncator-js

> Truncate text to the nearest word of a limit


## Install

With yarn:
```
$ yarn add truncator-js
```

With npm:
```
$ npm install --save truncator-js
```

## Usage

```js
const truncate = require('truncator-js');

// The function takes two arguments.
// The first is the selector you want to truncate using a '.classname' string.
// The second is the character limit that you wish to truncate on.

// truncate(selector, charLimit)

// Example
truncate('div.shortened', 100);

```

---
_Source: https://npm.io/package/truncator-js · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
