{"name":"iconv-lite","description":"Convert character encodings in pure javascript.","version":"0.5.0","license":"MIT","keywords":["iconv","convert","charset","icu"],"author":{"name":"Alexander Shtuchkin","email":"ashtuchkin@gmail.com"},"main":"./lib/index.js","typings":"./lib/index.d.ts","homepage":"https://github.com/ashtuchkin/iconv-lite","bugs":{"url":"https://github.com/ashtuchkin/iconv-lite/issues"},"repository":{"type":"git","url":"git://github.com/ashtuchkin/iconv-lite.git"},"engines":{"node":">=0.10.0"},"scripts":{"coverage":"istanbul cover _mocha -- --grep .","coverage-open":"open coverage/lcov-report/index.html","test":"mocha --reporter spec --grep ."},"browser":{"./lib/extend-node":false,"./lib/streams":false},"devDependencies":{"mocha":"^3.1.0","request":"~2.87.0","unorm":"*","errto":"*","async":"*","istanbul":"*","semver":"*","iconv":"*"},"dependencies":{"safer-buffer":">= 2.1.2 < 3"},"gitHead":"2b4125d11a733a40e45a755648389b2512a97a62","_id":"iconv-lite@0.5.0","_nodeVersion":"12.1.0","_npmVersion":"6.9.0","_npmUser":{"name":"ashtuchkin","email":"ashtuchkin@gmail.com"},"dist":{"integrity":"sha512-NnEhI9hIEKHOzJ4f697DMz9IQEXr/MMJ5w64vN2/4Ai+wRnvV7SBrL0KLoRlwaKVghOc7LQ5YkPLuX146b6Ydw==","shasum":"59cdde0a2a297cc2aeb0c6445a195ee89f127550","tarball":"http://registry-npm.ywwl.com/iconv-lite/download/iconv-lite-0.5.0.tgz","fileCount":27,"unpackedSize":346031,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdE/HdCRA9TVsSAnZWagAAtwwP/0A7gJ8ks851kXBTq6VJ\nhWlcoH4O4p+EXHO2oSPHqNiBVKme4KJH/eZelsKcLM3DdL4KjQEdGRT0kcEF\nimeagOhpZxIvP5uS54170P/uNpxtSxqFbpdWEmNoK6InVt2mKXbEosaIVIyu\nClFLlD0JftT3jkRe35egrN/2HTbI5tS/Xms15u41L5bgJnB7PAuXwZFBD9Rx\nHolgA2ENPHKXOzxJ2s338Cawonz3L2flW++KJwUIp6SgyFUrfOZfacSS/8UK\nQhaESFlnL17geSZOdgp/8Uxc8ClOFw8cs3lFVTW5tSsGBlVPwxgyEhTXKbXH\nRxPMycpRoulWGvpzfJuW114kco3KGsYpeHiafyQ2RBQUCXIXIfMUxztXjMtW\nNkTPNAwgW/X0P3cuUdx4tEwvHWFQLI4pscTufczsMLYn7cgMJs5pSaX/szYi\nrb14yLD02tBARpKH57PoEEfgustZvSJDCpKpaYycyzBIRSrXIsjBXpprQqab\nSZ9qoKuSJNRQueJTTDg2juSNHjQwucMQ0/5G1O9LnrRaiTjq8mY8Yq5Fm7aU\nu5GRwOZ0XdkqYV7QA7fbSKIG23VgqEjhl2HLESjhvPOHS4imw+/EUyMqyR8U\nb+lWqytvWRiGT0UNTz8swnNH1zvrkatb2MC320/dCK9VGsNJnBMSGNQOBZ2E\n8nnF\r\n=y8ow\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDzdhUvQE/LMgoRHBFxT8/lVVG+/P99wcXwc5+nZ5uSrgIgci49BnGRAUq356FxSIQQ6WL1DZ/QcDDnPhr9lZaInqs="}],"size":187393,"noattachment":false,"key":"/iconv-lite/-/iconv-lite-0.5.0.tgz"},"maintainers":[{"name":"ashtuchkin","email":"ashtuchkin@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/iconv-lite_0.5.0_1561588188650_0.5881942713503567"},"_hasShrinkwrap":false,"readme":"## iconv-lite: Pure JS character encoding conversion\n\n * No need for native code compilation. Quick to install, works on Windows and in sandboxed environments like [Cloud9](http://c9.io).\n * Used in popular projects like [Express.js (body_parser)](https://github.com/expressjs/body-parser), \n   [Grunt](http://gruntjs.com/), [Nodemailer](http://www.nodemailer.com/), [Yeoman](http://yeoman.io/) and others.\n * Faster than [node-iconv](https://github.com/bnoordhuis/node-iconv) (see below for performance comparison).\n * Intuitive encode/decode API, including Streaming support.\n * In-browser usage via [browserify](https://github.com/substack/node-browserify) or [webpack](https://webpack.js.org/) (~180kb gzip compressed with Buffer shim included).\n * Typescript [type definition file](https://github.com/ashtuchkin/iconv-lite/blob/master/lib/index.d.ts) included.\n * React Native is supported (need to install `stream` module to enable Streaming API).\n * License: MIT.\n\n[![NPM Stats](https://nodei.co/npm/iconv-lite.png)](https://npmjs.org/package/iconv-lite/)  \n[![Build Status](https://travis-ci.org/ashtuchkin/iconv-lite.svg?branch=master)](https://travis-ci.org/ashtuchkin/iconv-lite)\n[![npm](https://img.shields.io/npm/v/iconv-lite.svg)](https://npmjs.org/package/iconv-lite/)\n[![npm downloads](https://img.shields.io/npm/dm/iconv-lite.svg)](https://npmjs.org/package/iconv-lite/)\n[![npm bundle size](https://img.shields.io/bundlephobia/min/iconv-lite.svg)](https://npmjs.org/package/iconv-lite/)\n\n## Usage\n### Basic API\n```javascript\nvar iconv = require('iconv-lite');\n\n// Convert from an encoded buffer to a js string.\nstr = iconv.decode(Buffer.from([0x68, 0x65, 0x6c, 0x6c, 0x6f]), 'win1251');\n\n// Convert from a js string to an encoded buffer.\nbuf = iconv.encode(\"Sample input string\", 'win1251');\n\n// Check if encoding is supported\niconv.encodingExists(\"us-ascii\")\n```\n\n### Streaming API\n```javascript\n\n// Decode stream (from binary data stream to js strings)\nhttp.createServer(function(req, res) {\n    var converterStream = iconv.decodeStream('win1251');\n    req.pipe(converterStream);\n\n    converterStream.on('data', function(str) {\n        console.log(str); // Do something with decoded strings, chunk-by-chunk.\n    });\n});\n\n// Convert encoding streaming example\nfs.createReadStream('file-in-win1251.txt')\n    .pipe(iconv.decodeStream('win1251'))\n    .pipe(iconv.encodeStream('ucs2'))\n    .pipe(fs.createWriteStream('file-in-ucs2.txt'));\n\n// Sugar: all encode/decode streams have .collect(cb) method to accumulate data.\nhttp.createServer(function(req, res) {\n    req.pipe(iconv.decodeStream('win1251')).collect(function(err, body) {\n        assert(typeof body == 'string');\n        console.log(body); // full request body string\n    });\n});\n```\n\n## Supported encodings\n\n *  All node.js native encodings: utf8, ucs2 / utf16-le, ascii, binary, base64, hex.\n *  Additional unicode encodings: utf16, utf16-be, utf-7, utf-7-imap, utf32, utf32-le, and utf32-be.\n *  All widespread singlebyte encodings: Windows 125x family, ISO-8859 family, \n    IBM/DOS codepages, Macintosh family, KOI8 family, all others supported by iconv library. \n    Aliases like 'latin1', 'us-ascii' also supported.\n *  All widespread multibyte encodings: CP932, CP936, CP949, CP950, GB2312, GBK, GB18030, Big5, Shift_JIS, EUC-JP.\n\nSee [all supported encodings on wiki](https://github.com/ashtuchkin/iconv-lite/wiki/Supported-Encodings).\n\nMost singlebyte encodings are generated automatically from [node-iconv](https://github.com/bnoordhuis/node-iconv). Thank you Ben Noordhuis and libiconv authors!\n\nMultibyte encodings are generated from [Unicode.org mappings](http://www.unicode.org/Public/MAPPINGS/) and [WHATWG Encoding Standard mappings](http://encoding.spec.whatwg.org/). Thank you, respective authors!\n\n\n## Encoding/decoding speed\n\nComparison with node-iconv module (1000x256kb, on MacBook Pro, Core i5/2.6 GHz, Node v0.12.0). \nNote: your results may vary, so please always check on your hardware.\n\n    operation             iconv@2.1.4   iconv-lite@0.4.7\n    ----------------------------------------------------------\n    encode('win1251')     ~96 Mb/s      ~320 Mb/s\n    decode('win1251')     ~95 Mb/s      ~246 Mb/s\n\n## BOM handling\n\n * Decoding: BOM is stripped by default, unless overridden by passing `stripBOM: false` in options\n   (f.ex. `iconv.decode(buf, enc, {stripBOM: false})`).\n   A callback might also be given as a `stripBOM` parameter - it'll be called if BOM character was actually found.\n * If you want to detect UTF-8 BOM when decoding other encodings, use [node-autodetect-decoder-stream](https://github.com/danielgindi/node-autodetect-decoder-stream) module.\n * Encoding: No BOM added, unless overridden by `addBOM: true` option.\n\n## UTF-16 Encodings\n\nThis library supports UTF-16LE, UTF-16BE and UTF-16 encodings. First two are straightforward, but UTF-16 is trying to be\nsmart about endianness in the following ways:\n * Decoding: uses BOM and 'spaces heuristic' to determine input endianness. Default is UTF-16LE, but can be \n   overridden with `defaultEncoding: 'utf-16be'` option. Strips BOM unless `stripBOM: false`.\n * Encoding: uses UTF-16LE and writes BOM by default. Use `addBOM: false` to override.\n\n## UTF-32 Encodings\n\nThis library supports UTF-32LE, UTF-32BE and UTF-32 encodings. Like the UTF-16 encoding above, UTF-32 defaults to UTF-32LE, but uses BOM and 'spaces heuristics' to determine input endianness. \n * The default of UTF-32LE can be overridden with the `defaultEncoding: 'utf-32be'` option. Strips BOM unless `stripBOM: false`.\n * Encoding: uses UTF-32LE and writes BOM by default. Use `addBOM: false` to override. (`defaultEncoding: 'utf-32be'` can also be used here to change encoding.)\n\n## Other notes\n\nWhen decoding, be sure to supply a Buffer to decode() method, otherwise [bad things usually happen](https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding).  \nUntranslatable characters are set to � or ?. No transliteration is currently supported.  \nNode versions 0.10.31 and 0.11.13 are buggy, don't use them (see #65, #77).  \n\n## Testing\n\n```bash\n$ git clone git@github.com:ashtuchkin/iconv-lite.git\n$ cd iconv-lite\n$ npm install\n$ npm test\n    \n$ # To view performance:\n$ node test/performance.js\n\n$ # To view test coverage:\n$ npm run coverage\n$ open coverage/lcov-report/index.html\n```\n","publish_time":1561588188857,"_cnpm_publish_time":1561588188857,"dist-tags":{"bleeding":"0.4.0-pre3","latest":"0.7.3","next":"1.0.0-beta.1"}}