# entity-convert

> convert all special characters in a string to their corresponding HTML and CSS entities

Latest version **1.0.0** (published 2018-01-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install entity-convert
pnpm add entity-convert
yarn add entity-convert
bun add entity-convert
```

## 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 | 2018-01-24 |
| First published | 2014-02-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Frederik Ring |
| Maintainers | m90 |
| Keywords | string, entities, html, css |

## Links

- npm: https://www.npmjs.com/package/entity-convert
- Repository: https://github.com/m90/entity-convert
- Issues: https://github.com/m90/entity-convert/issues
- npm.io page: https://npm.io/package/entity-convert

## 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) — 2018-01-24
- 0.0.4 — 2014-09-11
- 0.0.3 — 2014-02-16
- 0.0.2 — 2014-02-16
- 0.0.1 — 2014-02-16
- 0.0.0 — 2014-02-16

## README

# entityconvert.js
> convert special characters in a string to their HTML or CSS charcode entities (useful for build tools et. al.)

The module works as AMD or CommonJS module and exports an Object exposing two methods: `.html(string)` and `.css(string)`. In a non-AMD and non-CommonJS environment `.entityconvert` will be attached to the global object.

AMD usage:
```javascript
require(['entityconvert'], function(entityconvert){
    var converted = entityconvert.html('We äll löve Ümläutß!');
    // => We &#228;ll l&#246;ve &#220;ml&#228;ut&#223;!
});
```

CommonJS usage:
```javascript
var entityconvert = require('entity-convert');
var converted = entityconvert.css('We äll löve Ümläutß!');
// => We \00e4ll l\00f6ve \00dcml\00e4ut\00df!
```

Script tag usage:
```html
<script src="entityconvert.js"></script>
<script>
	var converted = entityconvert.html('Yäy!');
	// => Y&#228;y!
</script>
```

Available via npm:
```sh
npm install entity-convert --save
```

##License
MIT © [Frederik Ring](http://www.frederikring.com)

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