# html-preview

> Trim down an HTML string to a specific length.

Latest version **1.0.0** (published 2016-04-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install html-preview
pnpm add html-preview
yarn add html-preview
bun add html-preview
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2016-04-24 |
| First published | 2016-04-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | ewnd9 |
| Maintainers | ewnd9 |
| Keywords | html, preview |

## Links

- npm: https://www.npmjs.com/package/html-preview
- Repository: https://github.com/ewnd9/html-preview
- Homepage: https://github.com/ewnd9/html-preview#readme
- Issues: https://github.com/ewnd9/html-preview/issues
- npm.io page: https://npm.io/package/html-preview

## Dependencies (1)

- [html-parse-stringify](https://npm.io/package/html-parse-stringify.md) ^1.0.2

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2016-04-24

## README

# html-preview

[![Build Status](https://travis-ci.org/ewnd9/html-preview.svg?branch=master)](https://travis-ci.org/ewnd9/html-preview)

Trim down an HTML string to a specific length.

Useful for creating previews for APIs which you can't control (e.g. RSS feeds)

## Install

```
$ npm install --save html-preview
```

## Usage

```js
const preview = require('html-preview');

const html = '<span>text1</span><span>test2</span><span>test3</span>';
const limit = 10;

preview(html, limit); //=> '<span>text1</span><span>test2</span>'
```

## License

MIT © [ewnd9](http://ewnd9.com)

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