JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 960
  • Score
    100M100P100Q96579F
  • License MIT

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

Package Exports

  • html-encode

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (html-encode) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

html-encode

Last version Build Status Coverage Status Dependency status Dev Dependencies Status NPM Status Donate

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, { encoding: null })
  const str = toUTF8(buffer, headers['content-type'])
  console.log(str)
})()

See more at examples.

License

The code is available under MIT license.