# convert-with-ents

> Light-weight tool for converting characters in a string into common HTML entities (without regex).

Latest version **1.0.2** (published 2021-10-30) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install convert-with-ents
pnpm add convert-with-ents
yarn add convert-with-ents
bun add convert-with-ents
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2021-10-30 |
| First published | 2021-10-28 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Rairye |
| Maintainers | rairye-nlp |
| Keywords | html, entity, converter, noregex |

## Links

- npm: https://www.npmjs.com/package/convert-with-ents
- Repository: https://github.com/Rairye/convert-with-ents/tree/main/convert-with-ents
- Homepage: https://github.com/Rairye/convert-with-ents
- npm.io page: https://npm.io/package/convert-with-ents

## 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.2 (latest) — 2021-10-30
- 1.0.1 — 2021-10-29
- 1.0.0 — 2021-10-28

## README

# convert-with-ents
Light-weight tool for converting characters in a string into common HTML entities (without regex).

Converts the following characters into the HTML entity equivalents.

1. Ampersand (&)
2. Less than (<)
3. Greater than (>)
4. Double quote (")
5. Single quote (')

Note: Ampersands are replaced by default, but they can be skipped. Please see the examples below.

## Code Sample

```javascript
import convertWithEnts from "convert-with-ents";

var source = "<text>Hey, how are you doing?<\/text>";
var result = convertWithEnts(source);
console.log(result);
```

If, for some reason, you need to skip ampersands, please use convertWithEnts(source, true)

```javascript
import convertWithEnts from "convert-with-ents";

var source = "<text>I like JS && Python.<\/text>";
var result = convertWithEnts(source, true);
console.log(result);
```

## Other Packages

If you would like to filter out or create a whitelist for punctuation characters, please see https://github.com/Rairye/js-mnl-punct-norm

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