{"_id":"str2buf","_rev":"4581178","name":"str2buf","description":"isomorphic string <=> buffer in 198 bytes","dist-tags":{"latest":"1.3.0"},"maintainers":[{"name":"kevlened","email":"boyettel@gmail.com"}],"time":{"modified":"2026-04-10T16:01:16.000Z","created":"2018-01-06T19:35:09.982Z","1.3.0":"2018-02-08T02:52:46.720Z","1.2.2":"2018-01-24T03:22:57.442Z","1.2.1":"2018-01-24T03:17:42.419Z","1.2.0":"2018-01-08T02:48:48.576Z","1.1.1":"2018-01-07T06:59:40.885Z","1.1.0":"2018-01-07T06:43:06.756Z","1.0.0":"2018-01-06T19:35:09.982Z"},"users":{},"repository":{"type":"git","url":"git+https://github.com/kevlened/str2buf.git"},"versions":{"1.3.0":{"name":"str2buf","version":"1.3.0","description":"isomorphic string <=> buffer in 198 bytes","main":"node/str2buf.js","module":"node/str2buf.mjs","browser":{"./node/str2buf.js":"./dist/str2buf.js","./node/str2buf.mjs":"./dist/str2buf.mjs"},"scripts":{"build":"microbundle --entry browser.mjs --output dist && microbundle --entry node.mjs --output node","prepublish":"npm run build","pretest":"npm run build","test":"node test","release":"npm test && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish"},"repository":{"type":"git","url":"git+https://github.com/kevlened/str2buf.git"},"keywords":["string","buffer"],"license":"MIT","bugs":{"url":"https://github.com/kevlened/str2buf/issues"},"files":["dist","fast","node"],"homepage":"https://github.com/kevlened/str2buf#readme","devDependencies":{"microbundle":"^0.2.4"},"gitHead":"362dac0c9ce431aba41de8f229881190fb40aea6","_id":"str2buf@1.3.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"kevlened","email":"boyettel@gmail.com"},"dist":{"shasum":"a4172afff4310e67235178e738a2dbb573abead0","size":2845,"noattachment":false,"key":"/str2buf/-/str2buf-1.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/str2buf/download/str2buf-1.3.0.tgz"},"maintainers":[{"name":"kevlened","email":"boyettel@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/str2buf_1.3.0_1518058366639_0.47515411820666853"},"_hasShrinkwrap":false,"publish_time":1518058366720,"_cnpm_publish_time":1518058366720,"_cnpmcore_publish_time":"2021-12-16T21:16:55.380Z"},"1.2.2":{"name":"str2buf","version":"1.2.2","description":"isomorphic string <=> buffer in 183 bytes","main":"node/str2buf.js","module":"node/str2buf.mjs","browser":{"./node/str2buf.js":"./dist/str2buf.js","./node/str2buf.mjs":"./dist/str2buf.mjs"},"scripts":{"build":"microbundle --entry browser.mjs --output dist && microbundle --entry node.mjs --output node && microbundle --entry browser-fast.mjs --output fast","prepublish":"npm run build","pretest":"npm run build","test":"node test","release":"npm test && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish"},"repository":{"type":"git","url":"git+https://github.com/kevlened/str2buf.git"},"keywords":["string","buffer"],"license":"MIT","bugs":{"url":"https://github.com/kevlened/str2buf/issues"},"files":["dist","fast","node"],"homepage":"https://github.com/kevlened/str2buf#readme","devDependencies":{"microbundle":"^0.2.4"},"gitHead":"08c003563691fb9496b5f00547126d0ea209988f","_id":"str2buf@1.2.2","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"kevlened","email":"boyettel@gmail.com"},"dist":{"shasum":"df88601148bf554a1f6cc8741ec4f9142f504aa3","size":3407,"noattachment":false,"key":"/str2buf/-/str2buf-1.2.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/str2buf/download/str2buf-1.2.2.tgz"},"maintainers":[{"name":"kevlened","email":"boyettel@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/str2buf-1.2.2.tgz_1516764177366_0.7125165681354702"},"directories":{},"publish_time":1516764177442,"_hasShrinkwrap":false,"_cnpm_publish_time":1516764177442,"_cnpmcore_publish_time":"2021-12-16T21:16:55.599Z"},"1.2.1":{"name":"str2buf","version":"1.2.1","description":"isomorphic string <=> buffer in 183 bytes","main":"node/str2buf.js","module":"node/str2buf.mjs","browser":{"./node/str2buf.js":"./dist/str2buf.js","./node/str2buf.mjs":"./dist/str2buf.mjs"},"scripts":{"build":"microbundle --entry browser.mjs --output dist && microbundle --entry node.mjs --output node && microbundle --entry browser-fast.mjs --output fast","prepublish":"npm run build","pretest":"npm run build","test":"node test","release":"npm test && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish"},"repository":{"type":"git","url":"git+https://github.com/kevlened/str2buf.git"},"keywords":["string","buffer"],"license":"MIT","bugs":{"url":"https://github.com/kevlened/str2buf/issues"},"files":["dist","fast","node"],"homepage":"https://github.com/kevlened/str2buf#readme","devDependencies":{"microbundle":"^0.2.4"},"gitHead":"e2b8740a13d6fd2727f9c93c9cdc65886d079472","_id":"str2buf@1.2.1","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"kevlened","email":"boyettel@gmail.com"},"dist":{"shasum":"4600e81c69171ac6f25f3eae7705f759ce8e442b","size":3404,"noattachment":false,"key":"/str2buf/-/str2buf-1.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/str2buf/download/str2buf-1.2.1.tgz"},"maintainers":[{"name":"kevlened","email":"boyettel@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/str2buf-1.2.1.tgz_1516763862335_0.1657272365409881"},"directories":{},"publish_time":1516763862419,"_hasShrinkwrap":false,"_cnpm_publish_time":1516763862419,"_cnpmcore_publish_time":"2021-12-16T21:16:55.885Z"},"1.2.0":{"name":"str2buf","version":"1.2.0","description":"isomorphic string <=> buffer in 183 bytes","main":"node/str2buf.js","module":"node/str2buf.mjs","browser":{"./node/str2buf.js":"./dist/str2buf.js","./node/str2buf.mjs":"./dist/str2buf.mjs"},"scripts":{"build":"microbundle --entry browser.mjs --output dist && microbundle --entry node.mjs --output node && microbundle --entry browser-fast.mjs --output fast","prepublish":"npm run build","pretest":"npm run build","test":"node test","release":"npm test && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish"},"repository":{"type":"git","url":"git+https://github.com/kevlened/str2buf.git"},"keywords":["string","buffer"],"license":"MIT","bugs":{"url":"https://github.com/kevlened/str2buf/issues"},"files":["dist","fast","node"],"homepage":"https://github.com/kevlened/str2buf#readme","devDependencies":{"microbundle":"^0.2.4"},"gitHead":"71d067093a9a9f0c73ac6087ca6db5a7d5dd3ac4","_id":"str2buf@1.2.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"kevlened","email":"boyettel@gmail.com"},"dist":{"shasum":"e9486bfcc34eba679f8b3ea07189dbcf4781a29b","size":3403,"noattachment":false,"key":"/str2buf/-/str2buf-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/str2buf/download/str2buf-1.2.0.tgz"},"maintainers":[{"name":"kevlened","email":"boyettel@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/str2buf-1.2.0.tgz_1515379728503_0.440736289601773"},"directories":{},"publish_time":1515379728576,"_hasShrinkwrap":false,"_cnpm_publish_time":1515379728576,"_cnpmcore_publish_time":"2021-12-16T21:16:56.077Z"},"1.1.1":{"name":"str2buf","version":"1.1.1","description":"isomorphic string <=> buffer in 215 bytes","main":"node/str2buf.js","module":"node/str2buf.mjs","browser":{"./node/str2buf.js":"./dist/str2buf.js","./node/str2buf.mjs":"./dist/str2buf.mjs"},"scripts":{"build":"microbundle --entry browser.mjs --output dist && microbundle --entry node.mjs --output node && microbundle --entry browser-fast.mjs --output fast","prepublish":"npm run build","pretest":"npm run build","test":"node test","release":"npm test && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish"},"repository":{"type":"git","url":"git+https://github.com/kevlened/str2buf.git"},"keywords":["string","buffer"],"license":"MIT","bugs":{"url":"https://github.com/kevlened/str2buf/issues"},"files":["dist","fast","node"],"homepage":"https://github.com/kevlened/str2buf#readme","devDependencies":{"microbundle":"^0.2.4"},"gitHead":"be9c2fb867b7f9059e6d25df6d271b09f84e5376","_id":"str2buf@1.1.1","_npmVersion":"5.6.0","_nodeVersion":"8.9.3","_npmUser":{"name":"kevlened","email":"boyettel@gmail.com"},"dist":{"shasum":"45c634f1f528a2e91b7cfe6e5ce5a67c08140980","size":3416,"noattachment":false,"key":"/str2buf/-/str2buf-1.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/str2buf/download/str2buf-1.1.1.tgz"},"maintainers":[{"name":"kevlened","email":"boyettel@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/str2buf-1.1.1.tgz_1515308380799_0.08217908628284931"},"directories":{},"publish_time":1515308380885,"_hasShrinkwrap":false,"_cnpm_publish_time":1515308380885,"_cnpmcore_publish_time":"2021-12-16T21:16:56.302Z"},"1.1.0":{"name":"str2buf","version":"1.1.0","description":"isomorphic string <=> buffer in 215 bytes","main":"node/str2buf.js","module":"node/str2buf.mjs","browser":{"./node/str2buf.js":"./dist/str2buf.js","./node/str2buf.mjs":"./dist/str2buf.mjs"},"scripts":{"build":"microbundle --entry browser.mjs --output dist && microbundle --entry node.mjs --output node && microbundle --entry browser-fast.mjs --output fast","prepublish":"npm run build","pretest":"npm run build","test":"node test","release":"npm test && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish"},"repository":{"type":"git","url":"git+https://github.com/kevlened/str2buf.git"},"keywords":["string","buffer"],"license":"MIT","bugs":{"url":"https://github.com/kevlened/str2buf/issues"},"files":["dist","fast","node"],"homepage":"https://github.com/kevlened/str2buf#readme","devDependencies":{"microbundle":"^0.2.4"},"gitHead":"9fe1d629b0b291b54f11e7b3d37bdffb6045bcc2","_id":"str2buf@1.1.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.3","_npmUser":{"name":"kevlened","email":"boyettel@gmail.com"},"dist":{"shasum":"d13a1200d28a52e70096ffbfa86e7246fbdb9b59","size":3406,"noattachment":false,"key":"/str2buf/-/str2buf-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/str2buf/download/str2buf-1.1.0.tgz"},"maintainers":[{"name":"kevlened","email":"boyettel@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/str2buf-1.1.0.tgz_1515307386633_0.2511145614553243"},"directories":{},"publish_time":1515307386756,"_hasShrinkwrap":false,"_cnpm_publish_time":1515307386756,"_cnpmcore_publish_time":"2021-12-16T21:16:56.478Z"},"1.0.0":{"name":"str2buf","version":"1.0.0","description":"isomorphic string <=> buffer in 215 bytes","main":"node/str2buf.js","browser":"dist/str2buf.js","module":"node/str2buf.mjs","scripts":{"build":"microbundle --entry browser.mjs --output dist && microbundle --entry node.mjs --output node && microbundle --entry browser-fast.mjs --output fast","prepublish":"npm run build","pretest":"npm run build","test":"node test","release":"npm test && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish"},"repository":{"type":"git","url":"git+https://github.com/kevlened/str2buf.git"},"keywords":["string","buffer"],"license":"MIT","bugs":{"url":"https://github.com/kevlened/str2buf/issues"},"files":["dist","fast","node"],"homepage":"https://github.com/kevlened/str2buf#readme","devDependencies":{"microbundle":"^0.2.4"},"gitHead":"972393c859f41db13230b04c6199b7e0777cd039","_id":"str2buf@1.0.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.3","_npmUser":{"name":"kevlened","email":"boyettel@gmail.com"},"dist":{"shasum":"5056bcf0d8befa5b4cdd8f8c7087b3c3dc1abdd9","size":3452,"noattachment":false,"key":"/str2buf/-/str2buf-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/str2buf/download/str2buf-1.0.0.tgz"},"maintainers":[{"name":"kevlened","email":"boyettel@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/str2buf-1.0.0.tgz_1515267309852_0.1610609833151102"},"directories":{},"publish_time":1515267309982,"_hasShrinkwrap":false,"_cnpm_publish_time":1515267309982,"_cnpmcore_publish_time":"2021-12-16T21:16:56.694Z"}},"readme":"# str2buf [![NPM](https://img.shields.io/npm/v/str2buf.svg)](https://npmjs.com/package/str2buf) [![Build](https://travis-ci.org/kevlened/str2buf.svg?branch=master)](https://travis-ci.org/kevlened/str2buf)\nisomorphic string <=> buffer in 198 bytes\n\n## Install\n\n`npm install str2buf`\n\n## Usage\n\nYou must provide strings where each character is represented by a single byte (also known as the binary string format). For example, the output of a `atob` operation or any ASCII string would be allowed.\n\n```javascript\nconst str2buf = require('str2buf')\n\nstr2buf.toUint8Array('hello')\n// new Uint8Array([104,101,108,108,111])\n\nstr2buf.fromUint8Array(new Uint8Array([104,101,108,108,111]))\n// 'hello'\n\nstr2buf.toBuffer('hello')\n// ArrayBuffer\n\nstr2buf.fromBuffer(new Uint8Array([104,101,108,108,111]).buffer)\n// 'hello'\n```\n\n## Can it be smaller?\n\nIf you use ES6 imports with a bundler that supports tree-shaking, yes!\n\n```javascript\nimport { fromUint8Array } from 'str2buf'\n```\n\n#### Perf profile\n\n```\n⏱ browser performance on 1000 arrays or strings of size 25003:\nstr2buf.fromUint8Array: 245.842ms\nstr2buf.toUint8Array: 165.240ms\nstr2buf.fromBuffer: 234.920ms\nstr2buf.toBuffer: 160.021ms\n\n⏱ node performance on 1000 arrays or strings of size 25003:\nstr2buf.fromUint8Array: 20.213ms\nstr2buf.toUint8Array: 15.655ms\nstr2buf.fromBuffer: 32.880ms\nstr2buf.toBuffer: 21.514ms\n```\n\n## License\n\nMIT","_attachments":{},"homepage":"https://github.com/kevlened/str2buf#readme","bugs":{"url":"https://github.com/kevlened/str2buf/issues"},"license":"MIT"}