Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Kikobeats/html-encode

Repository files navigation

html-encode

Last version Coverage Status NPM Status

A Node.js library for converting HTML documents of arbitrary encoding into a target encoding (utf8, utf16, etc).

Install

$ npm install html-encode

Usage

'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']?.split(';')[0].toLowerCase())
 console.log(str)
})()

See more at examples.

License

html-encode © Kiko Beats, released under the MIT License.
Authored and maintained by Kiko Beats with help from contributors.

kikobeats.com · GitHub Kiko Beats · X @Kikobeats

About

A Node.js library for converting HTML documents of arbitrary encoding into a target encoding (utf-8, utf-16, etc).

Topics

Resources

License

Stars

Watchers

Forks

Packages

Contributors

AltStyle によって変換されたページ (->オリジナル) /