{"name":"byte-length","description":"Get the real byte length of a string.","version":"1.0.2","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"},"files":["dist"],"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":"dist/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":"ac43901684c5abb621c2e92c8268c47394841cc9","_id":"byte-length@1.0.2","_npmVersion":"5.5.1","_nodeVersion":"8.4.0","_npmUser":{"name":"dylanpiercey","email":"pierceydylan@gmail.com"},"dist":{"integrity":"sha512-ovBpjmsgd/teRmgcPh23d4gJvxDoXtAzEL9xTfMU8Yc2kqCDb7L9jAG0XHl1nzuGl+h3ebCIF1i62UFyA9V/2Q==","shasum":"ba5a5909240b0121c079b7f7b15248d6f08223cc","tarball":"http://registry-npm.ywwl.com/byte-length/download/byte-length-1.0.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD08Vx20K+HwaCiHADuMCwZUbbcgHjD+1/zsyjKFzpZAQIgT3EFDZOlfDcC5bkOuHECgjhLNz02z2VnBICD1yTIUIA="}],"size":2221,"noattachment":false,"key":"/byte-length/-/byte-length-1.0.2.tgz"},"maintainers":[{"name":"dylanpiercey","email":"pierceydylan@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/byte-length-1.0.2.tgz_1508201205736_0.6627583813387901"},"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":1508201205816,"_cnpm_publish_time":1508201205816,"dist-tags":{"latest":"1.0.2"}}