package.json 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. {
  2. "name": "iconv-lite",
  3. "description": "Convert character encodings in pure javascript.",
  4. "version": "0.4.7",
  5. "license": "MIT",
  6. "keywords": [
  7. "iconv",
  8. "convert",
  9. "charset",
  10. "icu"
  11. ],
  12. "author": {
  13. "name": "Alexander Shtuchkin",
  14. "email": "ashtuchkin@gmail.com"
  15. },
  16. "contributors": [
  17. {
  18. "name": "Jinwu Zhan",
  19. "url": "https://github.com/jenkinv"
  20. },
  21. {
  22. "name": "Adamansky Anton",
  23. "url": "https://github.com/adamansky"
  24. },
  25. {
  26. "name": "George Stagas",
  27. "url": "https://github.com/stagas"
  28. },
  29. {
  30. "name": "Mike D Pilsbury",
  31. "url": "https://github.com/pekim"
  32. },
  33. {
  34. "name": "Niggler",
  35. "url": "https://github.com/Niggler"
  36. },
  37. {
  38. "name": "wychi",
  39. "url": "https://github.com/wychi"
  40. },
  41. {
  42. "name": "David Kuo",
  43. "url": "https://github.com/david50407"
  44. },
  45. {
  46. "name": "ChangZhuo Chen",
  47. "url": "https://github.com/czchen"
  48. },
  49. {
  50. "name": "Lee Treveil",
  51. "url": "https://github.com/leetreveil"
  52. },
  53. {
  54. "name": "Brian White",
  55. "url": "https://github.com/mscdex"
  56. },
  57. {
  58. "name": "Mithgol",
  59. "url": "https://github.com/Mithgol"
  60. },
  61. {
  62. "name": "Nazar Leush",
  63. "url": "https://github.com/nleush"
  64. }
  65. ],
  66. "main": "./lib/index.js",
  67. "homepage": "https://github.com/ashtuchkin/iconv-lite",
  68. "bugs": {
  69. "url": "https://github.com/ashtuchkin/iconv-lite/issues"
  70. },
  71. "repository": {
  72. "type": "git",
  73. "url": "git://github.com/ashtuchkin/iconv-lite.git"
  74. },
  75. "engines": {
  76. "node": ">=0.8.0"
  77. },
  78. "scripts": {
  79. "coverage": "istanbul cover _mocha -- --grep .",
  80. "coverage-open": "open coverage/lcov-report/index.html",
  81. "test": "mocha --reporter spec --grep ."
  82. },
  83. "browser": {
  84. "./extend-node": false,
  85. "./streams": false
  86. },
  87. "devDependencies": {
  88. "mocha": "*",
  89. "request": "2.47",
  90. "unorm": "*",
  91. "errto": "*",
  92. "async": "*",
  93. "istanbul": "*",
  94. "iconv": "2.1.4"
  95. },
  96. "readme": "## Pure JS character encoding conversion\n\n<!-- [![Build Status](https://secure.travis-ci.org/ashtuchkin/iconv-lite.png?branch=master)](http://travis-ci.org/ashtuchkin/iconv-lite) -->\n\n * Doesn't need native code compilation. 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\n * Streaming support for Node v0.10+\n * Can extend Node.js primitives (buffers, streams) to support all iconv-lite encodings.\n * In-browser usage via [Browserify](https://github.com/substack/node-browserify) (~180k gzip compressed with Buffer shim included).\n * License: MIT.\n\n[![NPM Stats](https://nodei.co/npm/iconv-lite.png?downloads=true)](https://npmjs.org/packages/iconv-lite/)\n\n## Usage\n### Basic API\n```javascript\nvar iconv = require('iconv-lite');\n\n// Convert from an encoded buffer to js string.\nstr = iconv.decode(new Buffer([0x68, 0x65, 0x6c, 0x6c, 0x6f]), 'win1251');\n\n// Convert from 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 (Node v0.10+)\n```javascript\n\n// Decode stream (from binary 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### Extend Node.js own encodings\n```javascript\n// After this call all Node basic primitives will understand iconv-lite encodings.\niconv.extendNodeEncodings();\n\n// Examples:\nbuf = new Buffer(str, 'win1251');\nbuf.write(str, 'gbk');\nstr = buf.toString('latin1');\nassert(Buffer.isEncoding('iso-8859-15'));\nBuffer.byteLength(str, 'us-ascii');\n\nhttp.createServer(function(req, res) {\n req.setEncoding('big5');\n req.collect(function(err, body) {\n console.log(body);\n });\n});\n\nfs.createReadStream(\"file.txt\", \"shift_jis\");\n\n// External modules are also supported (if they use Node primitives, which they probably do).\nrequest = require('request');\nrequest({\n url: \"http://github.com/\", \n encoding: \"cp932\"\n});\n\n// To remove extensions\niconv.undoExtendNodeEncodings();\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.\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, GB2313, 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.10.26). \nNote: your results may vary, so please always check on your hardware.\n\n operation iconv@2.1.4 iconv-lite@0.4.0\n ----------------------------------------------------------\n encode('win1251') ~130 Mb/s ~380 Mb/s\n decode('win1251') ~127 Mb/s ~210 Mb/s\n\n\n## 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. \nUses BOM to determine endianness, but doesn't remove it. Use ['strip-bom' module](https://github.com/sindresorhus/strip-bom). \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\n## Adoption\n[![NPM](https://nodei.co/npm-dl/iconv-lite.png)](https://nodei.co/npm/iconv-lite/)\n[![Codeship Status for ashtuchkin/iconv-lite](https://www.codeship.io/projects/81670840-fa72-0131-4520-4a01a6c01acc/status)](https://www.codeship.io/projects/29053)\n",
  97. "readmeFilename": "README.md",
  98. "_id": "iconv-lite@0.4.7",
  99. "_shasum": "89d32fec821bf8597f44609b4bc09bed5c209a23",
  100. "_from": "iconv-lite@0.4.7",
  101. "_resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.7.tgz"
  102. }