Big update!Introducing GitHub Bot Commands. Learn more
Socket
Log inBook a demo

encoding

Package Overview
Dependencies
1
Maintainers
1
Versions
13
Issues
File Explorer

Advanced tools

encoding

Convert encodings, uses iconv-lite

    0.1.13latest

Version published
Maintainers
1
Weekly downloads
9,981,002
decreased by-10.71%

Weekly downloads

Readme

Source

Encoding

encoding is a simple wrapper around iconv-lite to convert strings from one encoding to another.

Build Status npm version

Initially encoding was a wrapper around node-iconv (main) and iconv-lite (fallback) and was used as the encoding layer for Nodemailer/mailparser. Somehow it also ended up as a dependency for a bunch of other project, none of these actually using node-iconv. The loading mechanics caused issues for front-end projects and Nodemailer/malparser had moved on, so node-iconv was removed.

Install

Install through npm

npm install encoding

Usage

Require the module

var encoding = require("encoding");

Convert with encoding.convert()

var resultBuffer = encoding.convert(text, toCharset, fromCharset);

Where

  • text is either a Buffer or a String to be converted
  • toCharset is the characterset to convert the string
  • fromCharset (optional, defaults to UTF-8) is the source charset

Output of the conversion is always a Buffer object.

Example

var result = encoding.convert("ÕÄÖÜ", "Latin_1"); console.log(result); //<Buffer d5 c4 d6 dc>

License

MIT

FAQs

What is encoding?

Convert encodings, uses iconv-lite

Is encoding popular?

The npm package encoding receives a total of 8,047,108 weekly downloads. As such, encoding popularity was classified as popular.

Is encoding well maintained?

We found that encoding demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.It has 1 open source maintainer collaborating on the project.

Last updated on 10 Jul 2020

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc