# encoding

> Convert encodings, uses iconv-lite

Latest version **0.1.13** (published 2020-07-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install encoding
pnpm add encoding
yarn add encoding
bun add encoding
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.13 |
| Published | 2020-07-10 |
| First published | 2012-08-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 88 |
| Author | Andris Reinman |
| Maintainers | andris |

## Links

- npm: https://www.npmjs.com/package/encoding
- Repository: https://github.com/andris9/encoding
- Homepage: https://github.com/andris9/encoding#readme
- Issues: https://github.com/andris9/encoding/issues
- npm.io page: https://npm.io/package/encoding

## Dependencies (1)

- [iconv-lite](https://npm.io/package/iconv-lite.md) ^0.6.2

## Recent versions

- 0.1.13 (latest) — 2020-07-10
- 0.1.12 — 2015-12-23
- 0.1.11 — 2014-11-08
- 0.1.10 — 2014-10-16
- 0.1.9 — 2014-10-13
- 0.1.8 — 2014-06-17
- 0.1.7 — 2013-09-03
- 0.1.6 — 2013-03-23
- 0.1.5 — 2012-11-07
- 0.1.4 — 2012-09-14
- 0.1.3 — 2012-09-04
- 0.1.2 — 2012-08-16
- 0.1.1 — 2012-08-16

## README

# Encoding

**encoding** is a simple wrapper around [iconv-lite](https://github.com/ashtuchkin/iconv-lite/) to convert strings from one encoding to another.

[![Build Status](https://secure.travis-ci.org/andris9/encoding.svg)](http://travis-ci.org/andris9/Nodemailer)
[![npm version](https://badge.fury.io/js/encoding.svg)](http://badge.fury.io/js/encoding)

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**

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