{"name":"byte-length","description":"Get the real byte length of a string.","version":"1.0.0","author":{"name":"Dylan Piercey","email":"pierceydylan@gmail.com"},"bugs":{"url":"https://github.com/DylanPiercey/byte-length/issues"},"devDependencies":{"@types/mocha":"^2.2.43","@types/node":"^8.0.34","coveralls":"^3.0.0","husky":"^0.14.3","lint-staged":"^4.2.3","mocha":"^4.0.1","nyc":"^11.2.1","prettier":"^1.7.4","ts-node":"^3.3.0","tslint":"^5.7.0","tslint-config-prettier":"^1.5.0","typescript":"^2.5.3"},"homepage":"https://github.com/DylanPiercey/byte-length","keywords":["bytes","content-length","length","string"],"license":"MIT","lint-staged":{"*.ts":["prettier --write","tslint -t codeFrame -c tslint.json","git add"]},"main":"index.js","repository":{"type":"git","url":"git+https://github.com/DylanPiercey/byte-length.git"},"scripts":{"build":"tsc","coveralls":"cat coverage/lcov.info | coveralls","format-all":"find {src,test} -name '*.ts' | xargs prettier --write","mocha":"mocha -r ts-node/register ./test/**/*.test.ts","precommit":"lint-staged && npm test && npm run build","test":"nyc --extension=.ts --include=src/**/*.ts --reporter=lcov --reporter=text-summary npm run mocha","test-ci":"nyc --extension=.ts --include=src/**/*.ts --reporter=lcovonly --reporter=text npm run mocha"},"types":"dist/index.d.ts","gitHead":"8a1d21cbde7baa6d42489bb9d8bffdb290b9896d","_id":"byte-length@1.0.0","_npmVersion":"5.5.1","_nodeVersion":"8.4.0","_npmUser":{"name":"dylanpiercey","email":"pierceydylan@gmail.com"},"dist":{"integrity":"sha512-wjuzogx3/tLtJFASKwrDyzrCFUEM3rsTs6QaWhQZuS6aZuqd5o4y0NssrUW2pNA+O4Bxn9II2bLWHnGBcm+tzQ==","shasum":"8b6c3790660e7cb4b8d1c561f9e31533ed476e9c","tarball":"http://registry-npm.ywwl.com/byte-length/download/byte-length-1.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE5bO2LaQo5jxtqahMlr/vSN7PzeeThmSxTprZRHipA2AiAwq9kHdrS7qQkXhM+g76xPUemV/buuq1P6WC4s5x2qfQ=="}],"size":2466,"noattachment":false,"key":"/byte-length/-/byte-length-1.0.0.tgz"},"maintainers":[{"name":"dylanpiercey","email":"pierceydylan@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/byte-length-1.0.0.tgz_1508026062470_0.7059811560902745"},"directories":{},"readme":"<h1 align=\"center\">\n  <!-- Logo -->\n  <br/>\n  Byte-Length\n\t<br/>\n\n  <!-- Stability -->\n  <a href=\"https://nodejs.org/api/documentation.html#documentation_stability_index\">\n    <img src=\"https://img.shields.io/badge/stability-stable-brightgreen.svg\" alt=\"API Stability\"/>\n  </a>\n  <!-- TypeScript -->\n  <a href=\"http://typescriptlang.org\">\n    <img src=\"https://img.shields.io/badge/%3C%2F%3E-typescript-blue.svg\" alt=\"TypeScript\"/>\n  </a>\n  <!-- Prettier -->\n  <a href=\"https://github.com/prettier/prettier\">\n    <img src=\"https://img.shields.io/badge/styled_with-prettier-ff69b4.svg\" alt=\"Styled with prettier\"/>\n  </a>\n  <!-- Travis build -->\n  <a href=\"https://travis-ci.org/DylanPiercey/byte-length\">\n  <img src=\"https://img.shields.io/travis/DylanPiercey/byte-length.svg\" alt=\"Build status\"/>\n  </a>\n  <!-- Coveralls coverage -->\n  <a href=\"https://coveralls.io/github/DylanPiercey/byte-length\">\n    <img src=\"https://img.shields.io/coveralls/DylanPiercey/byte-length.svg\" alt=\"Test Coverage\"/>\n  </a>\n  <!-- NPM version -->\n  <a href=\"https://npmjs.org/package/byte-length\">\n    <img src=\"https://img.shields.io/npm/v/byte-length.svg\" alt=\"NPM Version\"/>\n  </a>\n  <!-- Downloads -->\n  <a href=\"https://npmjs.org/package/byte-length\">\n    <img src=\"https://img.shields.io/npm/dm/byte-length.svg\" alt=\"Downloads\"/>\n  </a>\n  <!-- Size -->\n  <a href=\"https://npmjs.org/package/byte-length\">\n    <img src=\"https://img.shields.io/badge/size-422b-green.svg\" alt=\"Browser Bundle Size\"/>\n  </a>\n</h1>\n\nCalculate the real byte length of any string.\n\n# Why\nIn node many will use `Buffer.byteLength`, however including the entire buffer shim in the browser just for getting the byte length of a string is not very conservative.\n\n# Installation\n\n```console\nnpm install byte-length\n```\n\n# Example\n\n```javascript\nimport { byteLength } from \"byte-length\";\n\nbyteLength(\"hello\"); //-> 5\nbyteLength(\"😀\"); //-> 4\nbyteLength(\"ｆｕｌｌｗｉｄｔｈ　ｃｈａｒａｃｔｅｒｓ\"); //-> 60\n```\n\n### Contributions\n\n* Use `npm test` to run tests.\n\nPlease feel free to create a PR!\n","publish_time":1508026062586,"_cnpm_publish_time":1508026062586,"dist-tags":{"latest":"1.0.2"}}