{"name":"chardet","version":"0.6.0","homepage":"https://github.com/runk/node-chardet","description":"Character detector","keywords":["encoding","character","utf8","detector","chardet","icu"],"author":{"name":"Dmitry Shirokov","email":"deadrunk@gmail.com"},"contributors":[{"name":"@spikying"},{"name":"@wtgtybhertgeghgtwtg"},{"name":"@suisho"},{"name":"@seangarner"},{"name":"@zevanty"}],"devDependencies":{"github-publish-release":"^4.2.0","mocha":"^5.1.1"},"repository":{"type":"git","url":"git+ssh://git@github.com/runk/node-chardet.git"},"bugs":{"url":"http://github.com/runk/node-chardet/issues"},"scripts":{"test":"mocha -R spec --recursive --bail","release":"scripts/release"},"main":"index.js","engine":{"node":">=4"},"directories":{"test":"test"},"license":"MIT","gitHead":"6ff1aea137cd3288d9a4c693d5389b88edac7bb1","_id":"chardet@0.6.0","_npmVersion":"5.6.0","_nodeVersion":"8.11.1","_npmUser":{"name":"runk","email":"deadrunk@gmail.com"},"dist":{"integrity":"sha512-6oOgb0JQEsVfn64D9lWHxIj052QCn2CsdPGz9GLZfmss+6F8LWVOgFiKGSjEI8P0B3Ccdo9m7lU30VpOI9IyRg==","shasum":"9a9b264a18efeb9f797de19252fb1f2adccda616","tarball":"http://registry-npm.ywwl.com/chardet/download/chardet-0.6.0.tgz","fileCount":11,"unpackedSize":74825,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbOvQrCRA9TVsSAnZWagAAw60P/2Qy05jAezCt0uNWo9yA\nGO2qZ4DDAKxAgR8AQgRkUVwbe5Ni1iNsZAjOIidHtBD6hcxfdlBHrMTTBi9U\niElcG6a3/5YHoE7MEVAJD5u1OQAYjQsiSEg6NfIIx2LgjwDC6TzfjMd0Qgss\npdLMeAT5J6CldaB1ruH6kAF4k+nbk67MuxTMqoIriAKI/DQCKcip0I84MwjK\nUvnnO0k63ah18f4eGmDGsBC2gdUIg4wQL5E5ZeKAvfDVdI3TuqwX0cxqU3Wy\nM4BRgQSAbnQYSwJP4XoxmVFUq6jR1LHszjWRF4UjmmcFSjcA6vxqC0NHPSKl\nQM5sgFI5QhrafDgmO5iFYI2aIbK8ZoDNA9NSiGPvZMFtqUupQSLu2Fln1I9b\neZPHKz6fvn/AmgB5ElMHf2DoLTn9Z1vkpt3OvSWwsriNr6G5I5ZrWxuQ4a33\nV+kj4byB1tjs7io2uR41BOimTasv9mSmSZjZ6KOnin441mzC+S0wjc9oVXKN\nz4p/o6e+rsTexvQwWsMwqKDDnJmulOSifuDfVNS8hGHkHCQ0iX25QNhkxkFR\nA00h2XOxc/z00Y6UluqzqlNOz+D52BS4xgyPDBhTD7oz6UPcnCmV4YOwCsDH\nCSIBPawkK4aSfHN5JR94UTQ1rPgUzYsOM5OSBXLi/dxre7Rt7QXzKeysUK7d\ndmd+\r\n=T+7B\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDnTKH1XKSyulmH6siv7O1ZUemmBFuLti4uir5WcomM+QIgA/fX0XiU4XeHn+aMkN64H6w37hkM8BgoKWfBuGgnUP4="}],"size":16900,"noattachment":false,"key":"/chardet/-/chardet-0.6.0.tgz"},"maintainers":[{"name":"runk","email":"deadrunk@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/chardet_0.6.0_1530590251335_0.11682330319261358"},"_hasShrinkwrap":false,"readme":"# chardet\n\n_Chardet_ is a character detection module written in pure JavaScript (TypeScript). Module uses occurrence analysis to determine the most probable encoding.\n\n- Packed size is only **22 KB**\n- Works in all environments: Node / Browser / Native\n- Works on all platforms: Linux / Mac / Windows\n- No dependencies\n- No native code / bindings\n- 100% written in TypeScript\n- Extensive code coverage\n\n## Installation\n\n```\nnpm i chardet\n```\n\n## Usage\n\nTo return the encoding with the highest confidence:\n\n```javascript\nimport chardet from 'chardet';\n\nconst encoding = chardet.detect(Buffer.from('hello there!'));\n// or\nconst encoding = await chardet.detectFile('/path/to/file');\n// or\nconst encoding = chardet.detectFileSync('/path/to/file');\n```\n\nTo return the full list of possible encodings use `analyse` method.\n\n```javascript\nimport chardet from 'chardet';\nchardet.analyse(Buffer.from('hello there!'));\n```\n\nReturned value is an array of objects sorted by confidence value in descending order\n\n```javascript\n[\n  { confidence: 90, name: 'UTF-8' },\n  { confidence: 20, name: 'windows-1252', lang: 'fr' },\n];\n```\n\nIn browser, you can use [Uint8Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) instead of the `Buffer`:\n\n```javascript\nimport chardet from 'chardet';\nchardet.analyse(new Uint8Array([0x68, 0x65, 0x6c, 0x6c, 0x6f]));\n```\n\n## Working with large data sets\n\nSometimes, when data set is huge and you want to optimize performance (with a tradeoff of less accuracy),\nyou can sample only the first N bytes of the buffer:\n\n```javascript\nchardet\n  .detectFile('/path/to/file', { sampleSize: 32 })\n  .then((encoding) => console.log(encoding));\n```\n\nYou can also specify where to begin reading from in the buffer:\n\n```javascript\nchardet\n  .detectFile('/path/to/file', { sampleSize: 32, offset: 128 })\n  .then((encoding) => console.log(encoding));\n```\n\n## Supported Encodings:\n\n- UTF-8\n- UTF-16 LE\n- UTF-16 BE\n- UTF-32 LE\n- UTF-32 BE\n- ISO-2022-JP\n- ISO-2022-KR\n- ISO-2022-CN\n- Shift_JIS\n- Big5\n- EUC-JP\n- EUC-KR\n- GB18030\n- ISO-8859-1\n- ISO-8859-2\n- ISO-8859-5\n- ISO-8859-6\n- ISO-8859-7\n- ISO-8859-8\n- ISO-8859-9\n- windows-1250\n- windows-1251\n- windows-1252\n- windows-1253\n- windows-1254\n- windows-1255\n- windows-1256\n- KOI8-R\n\nCurrently only these encodings are supported.\n\n## TypeScript?\n\nYes. Type definitions are included.\n\n### References\n\n- ICU project http://site.icu-project.org/\n","publish_time":1530590251422,"_cnpm_publish_time":1530590251422,"dist-tags":{"latest":"2.2.0"}}