Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kikobeats/html-encode
A Node.js library for converting HTML documents of arbitrary encoding into a target encoding (utf-8, utf-16, etc).
https://github.com/kikobeats/html-encode
entities html html-encoder html-entities
Last synced: 8 days ago
JSON representation
A Node.js library for converting HTML documents of arbitrary encoding into a target encoding (utf-8, utf-16, etc).
- Host: GitHub
- URL: https://github.com/kikobeats/html-encode
- Owner: Kikobeats
- License: mit
- Created: 2017-11-22T13:41:44.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2024-05-08T08:28:27.000Z (8 months ago)
- Last Synced: 2024-10-17T17:56:34.775Z (3 months ago)
- Topics: entities, html, html-encoder, html-entities
- Language: JavaScript
- Homepage:
- Size: 225 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# html-encode
![Last version](https://img.shields.io/github/tag/Kikobeats/html-encode.svg?style=flat-square)
[![Coverage Status](https://img.shields.io/coveralls/Kikobeats/html-encode.svg?style=flat-square)](https://coveralls.io/github/Kikobeats/html-encode)
[![NPM Status](https://img.shields.io/npm/dm/html-encode.svg?style=flat-square)](https://www.npmjs.org/package/html-encode)> A Node.js library for converting HTML documents of arbitrary encoding into a target encoding (utf8, utf16, etc).
### Install
```bash
$ npm install html-encode
```### Usage
```js
'use strict'const got = require('got')
const toUTF8 = require('html-encode')('utf-8')
const url = process.argv[2];(async () => {
const { body: buffer, headers } = await got(url, { responseType: 'buffer' })
const str = toUTF8(buffer, headers['content-type'])
console.log(str)
})()
```See more at [examples](/examples).
## License
**html-encode** © [Kiko Beats](https://kikobeats.com), released under the [MIT](https://github.com/Kikobeats/html-encode/blob/master/LICENSE.md) License.
Authored and maintained by Kiko Beats with help from [contributors](https://github.com/Kikobeats/html-encode/contributors).> [kikobeats.com](https://kikobeats.com) · GitHub [Kiko Beats](https://github.com/Kikobeats) · Twitter [@Kikobeats](https://twitter.com/Kikobeats)