{"name":"chardet","version":"1.5.1","homepage":"https://github.com/runk/node-chardet","description":"Character encoding detector","license":"MIT","repository":{"type":"git","url":"git+https://github.com/runk/node-chardet.git"},"bugs":{"url":"http://github.com/runk/node-chardet/issues"},"scripts":{"build":"rm -rf lib/* && tsc","format":"prettier --write ./src/**/*.ts","format:check":"prettier --list-different ./src/**/*.ts","test":"jest","prepublish":"npm run build","semantic-release":"semantic-release"},"main":"lib/index.js","typings":"lib/index.d.ts","engine":{"node":">=4"},"directories":{"test":"test"},"devDependencies":{"@types/jest":"^29.0.0","@types/node":"^18.0.0","jest":"^29.0.0","prettier":"^2.7.1","semantic-release":"^19.0.5","ts-jest":"^29.0.0","ts-node":"^10.9.1","typescript":"^4.8.4"},"keywords":["encoding","character","utf8","detector","chardet","icu","character detection","character encoding","language","iconv","iconv-light","UTF-8","UTF-16","UTF-32","ISO-2022-JP","ISO-2022-KR","ISO-2022-CN","Shift_JIS","Big5","EUC-JP","EUC-KR","GB18030","ISO-8859-1","ISO-8859-2","ISO-8859-5","ISO-8859-6","ISO-8859-7","ISO-8859-8","ISO-8859-9","windows-1250","windows-1251","windows-1252","windows-1253","windows-1254","windows-1255","windows-1256","KOI8-R"],"author":{"name":"Dmitry Shirokov","email":"deadrunk@gmail.com"},"contributors":[{"name":"@spikying"},{"name":"@wtgtybhertgeghgtwtg"},{"name":"@suisho"},{"name":"@seangarner"},{"name":"@zevanty"}],"browser":{"./lib/fs/node.js":"./lib/fs/browser.js"},"gitHead":"fbef68123055d397fbecdf5d075506a701fd965f","_id":"chardet@1.5.1","_nodeVersion":"14.21.1","_npmVersion":"8.19.3","dist":{"integrity":"sha512-0XMOtA52igKDOIfvJZJ6v0+J9yMF3IuYyEa5oFUxBXA01G6mwCNKpul3bgbFf7lmZuqwN/oyg/zQ1cGS7NyJkQ==","shasum":"2a15770a46ce15e25a99f2741c949f43f9925dd5","tarball":"http://registry-npm.ywwl.com/chardet/download/chardet-1.5.1.tgz","fileCount":33,"unpackedSize":156078,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFQZV9XmsexrZUT+0b4lesVmqFfqKlCmnjF2J+trd27vAiAW7DbAz/z4hRes69YRvUhP12wP5cAia74bV+HnzxKU5w=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjt0r0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqiRhAAlRKbVs+jG5aEuutU1Lt8H9GSma+6eoD7zf/MVbYidE/MoJTK\r\nXtVp28ncuGIer1z/j4B90Hi6EMYg02nbDLtFqDcvjEhmWIZGPoDq7XAzP1X2\r\nsURZOAVWfjJJXfV5/Iv8f69DPLt/1pY7cxAU2WMsSDW0e/yfFHUidoMx3Wou\r\nC81Y7wYHo2w83y+/lwXNVYHjognYS+8ZCNGJ7FOwzRvdTnP+C7zetTHzjTPv\r\n77NPohGHNfXLZadW8PZitQwofc7ZZlEIDlBCpRkMxZcO7pU7Q2jk8F3/InAN\r\n/7Gph8a9JZjUOPS/YRXVYYkP+7gpDiKDSbiSqCPL7yJy7HRVS5jga11xgqXN\r\ndzlD6ANxn4KLdSxQuQEJZlO+Fu8pGSIiFHUjC1M5fwepM8obp2OAH/SXHwR5\r\n5qnNkPvYNyvqSL6LKYmNKYPrE2BozvKPaP62LyYWSkcL1fs2MUwUuZnQS19V\r\nKQuYkoWBcZ6ATHxRrtfZNpnVMhcDJr6wej4uUF7UL9hWuyrvh75YbiKBaLEg\r\nNjydC78+42qQcQzFTEw2sLj9osH8GVaBOaR7/g/aVJV+NZuTfzL15DrNlsg0\r\nmf2cdT1yPK6zLXfANNgMGToGYOlcjXWq4n5O3/HTJOrDow8BnYKmEdgPvogM\r\nXlnF69/ATe3lWFyNgQltDHvNyno+8CHhp1Y=\r\n=VetR\r\n-----END PGP SIGNATURE-----\r\n","size":21783,"noattachment":false,"key":"/chardet/-/chardet-1.5.1.tgz"},"_npmUser":{"name":"runk","email":"deadrunk@gmail.com"},"maintainers":[{"name":"runk","email":"deadrunk@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/chardet_1.5.1_1672956660541_0.34600868263521645"},"_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":1672956660748,"_cnpm_publish_time":1672956660748,"dist-tags":{"latest":"2.2.0"}}