{"name":"chardet","version":"1.1.0","homepage":"https://github.com/runk/node-chardet","description":"Character 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","lint":"tslint -p tsconfig.json -c tslint.json","lint:types":"tsc --noEmit","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":"^25.1.4","@types/node":"^13.9.5","jest":"^25.2.4","prettier":"^2.0.2","semantic-release":"^15.14.0","ts-jest":"^25.2.1","tslint":"^6.1.0","typescript":"^3.8.3"},"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"}],"gitHead":"28db00677d7e4c86cd26b0cf9ad67e687b485359","_id":"chardet@1.1.0","_nodeVersion":"12.16.3","_npmVersion":"6.14.4","dist":{"integrity":"sha512-K6BWWdt9ncg6TDTX42J57s9zZWVI1DXVYQ6zUM8dZUB2TDeV5ia4kDei19r/pMxNzSGYYf6LqHsyvEybvTPHuA==","shasum":"c653dfc04731e8bfa90da4fd4968d69129d72b12","tarball":"http://registry-npm.ywwl.com/chardet/download/chardet-1.1.0.tgz","fileCount":67,"unpackedSize":1183749,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJetJYrCRA9TVsSAnZWagAASbcQAJfu62wSeLuz+JhsY9d8\n3VBHI7bimLy3tPuNVuhdlo/S+V9KOxeb+5XgmgoBN5yFVsu3wlQeuuITWvdm\nyy4AuPHR2ajOk0MUMnRQiICp8cXGmPWKkivLm3tuBtO2l505OwnWC5Ivn7Nc\npOoBr1xF51ijfz3kjCz7UbIQDlbNLwIXoE0Ay/qfui2fvn8KyQe0HsC6qMdX\nc4H+QhBS6bmpkE3S5qEAMjHEZATvVaTIZE0SywhcE+DeVgXryOsJKktqCiBS\n8kr+jIpiH7Ra3DTfhnL5z2+sHnkPDqqnQYjuW9bza+AJisCx9FQzPo0bTvPK\nQ/A74McU4yfwbpDTLzWeFqG7N4tYKHu17G9LYKMVWCt7GQhpgD9JEF1TxUm4\nm3nHjzXn7X27uOmBQ8R0DF6QH15G+WZdOvUmvHPS2JK2yM3lWsf9ewJDv5uY\nXM3PW6nckys9CX/+kOiZE8XDOjggJ6naE/Sx1dohF5BnZjwvWRBgo791KVIX\nJcLUt6+RPsDocRst/1TgKYovhjyExDU0IYeNr+QeG/7KW9WQA2FfldPzPf9n\nJoDXOpXdlUohnLkR4eYHqoRw5h966PYwshFFnCnvOQIRsf7LvRJ0/E5+GyVw\nSOqCoao+ILN7bjF2Mg9hOXggLrVJIN79xmW6Nn3N0EE0gfQnIUbzdZuatj1q\n3AW1\r\n=C2S7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGDhANv2cmGnvQqy5VL801U63b8IG79XcH8OfTJ6HC4rAiB7w3MDWnRCPT4pRqpMm4ZiLF4PZic/KBiZ6/EG1Hhvew=="}],"size":135436,"noattachment":false,"key":"/chardet/-/chardet-1.1.0.tgz"},"maintainers":[{"name":"runk","email":"deadrunk@gmail.com"}],"_npmUser":{"name":"runk","email":"deadrunk@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/chardet_1.1.0_1588893226325_0.9006303723967923"},"_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":1588893226464,"_cnpm_publish_time":1588893226464,"dist-tags":{"latest":"2.2.0"}}