{"_id":"browserify-unibabel","_rev":"4-7a14f34d237bb367b3ed4e95d7fb7351","name":"browserify-unibabel","description":"Base64, TypedArrays, and UTF-8 / Unicode conversions in Browser (and Node) JavaScript","dist-tags":{"latest":"3.0.0"},"versions":{"2.1.3":{"name":"browserify-unibabel","version":"2.1.3","description":"Base64, TypedArrays, and UTF-8 / Unicode conversions in Browser (and Node) JavaScript","main":"node.js","browser":{"./node.js":"./index.js"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/coolaj86/unibabel-js.git"},"keywords":["ascii","binary","utf8","utf-8","ArrayBuffer","TypedArrays","TypedArray","Uint","Uint8Array","Base64","b64","Base32","b32"],"author":{"name":"AJ ONeal","email":"coolaj86@gmail.com","url":"http://coolaj86.com/"},"license":"Apache-2.0","bugs":{"url":"https://github.com/coolaj86/unibabel-js/issues"},"homepage":"https://github.com/coolaj86/unibabel-js#readme","gitHead":"5812443ba47847fb4c7de8bdad8827ca552e948d","_id":"browserify-unibabel@2.1.3","_shasum":"8db92b30fc3d9e51ad1f6ab711f510c335773140","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.3.1","_npmUser":{"name":"danfinlay","email":"dan@danfinlay.com"},"dist":{"shasum":"8db92b30fc3d9e51ad1f6ab711f510c335773140","tarball":"https://registry.npmjs.org/browserify-unibabel/-/browserify-unibabel-2.1.3.tgz","integrity":"sha512-NWMlyjluEwUoyvRbGqlEoLVmOYkC1UzV+NvHRv4o7Tip0oTh7beSgzzG9agtcH+8dJGpP/v8ryWYHe/DIw6ogw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC5No+Ro3KMnpI1zUW2wQL+Sm98mMaVh3Yksy2QKdgqYAiAqKZ+hNv2KjbJkSTkG8JVypiiUpn5EkWvslKz6Bwm2/Q=="}]},"maintainers":[{"name":"danfinlay","email":"dan@danfinlay.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/browserify-unibabel-2.1.3.tgz_1482256709680_0.792254616972059"}},"3.0.0":{"name":"browserify-unibabel","version":"3.0.0","description":"Base64, TypedArrays, and UTF-8 / Unicode conversions in Browser (and Node) JavaScript","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/coolaj86/unibabel-js.git"},"keywords":["ascii","binary","utf8","utf-8","ArrayBuffer","TypedArrays","TypedArray","Uint","Uint8Array","Base64","b64","Base32","b32"],"author":{"name":"AJ ONeal","email":"coolaj86@gmail.com","url":"http://coolaj86.com/"},"license":"Apache-2.0","bugs":{"url":"https://github.com/coolaj86/unibabel-js/issues"},"homepage":"https://github.com/coolaj86/unibabel-js#readme","gitHead":"8ff7c26a6df15f68c18c12b6f5e031b2cc4ef658","_id":"browserify-unibabel@3.0.0","_shasum":"5a6b8f0f704ce388d3927df47337e25830f71dda","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.3.1","_npmUser":{"name":"danfinlay","email":"dan@danfinlay.com"},"dist":{"shasum":"5a6b8f0f704ce388d3927df47337e25830f71dda","tarball":"https://registry.npmjs.org/browserify-unibabel/-/browserify-unibabel-3.0.0.tgz","integrity":"sha512-j3MX0k2dC1/DEo9jSUyj7zpv5wLd1+klpFwYlM0E5mr7MX6LblQOWb+jkBEKV2iRszmhJuLHAtNuqranlGnpNQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC7WuYriReLFh19VIdb0dJMUwKYr9zd14bdghij4mNQfgIgff1cozOSRMVuom4cYGlXvEYqySagko0l3BpY8Q9yI88="}]},"maintainers":[{"name":"danfinlay","email":"dan@danfinlay.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/browserify-unibabel-3.0.0.tgz_1482257434938_0.998754107626155"}}},"readme":"Unibabel JS: The Browserify-Ready Unibabel\n========\n\nA simple browserify style version of Unibabel, exported as a module instead of as a global object.\n\nCurrently does not support the add-in support for hex or base32, because I didn't need them when I made this, and its extendable format is a little unusual.  So, PRs welcome.\n\n## Usage\n\n```javascript\nvar Unibabel = require('unibabel-js')\n\n// Now you can use Unibabel like the original docs below.\n```\n\n## Another caveat\n\nThe original Unibabel fails hard when loaded into node.js, but this one doesn't. That's because I unit-test some things that include this in a node environment, even when not using it.  I think the hard failure was a little extreme.\n\nTo reiterate the error:  You shouldn't use this in node.js, you have Buffers in node.js, and they do this all better.\n\n# Original Unibabel Docs\n\nMinimalistic **Base64**, **TypedArrays**, and **UTF-8** / **Unicode** conversions in Browser (and Node) JavaScript. Optional add-on support for **hex** and **base32**.\n\nSee <https://coolaj86.com/articles/base64-unicode-utf-8-javascript-and-you/>\n\nSee also\n\n  * [TextEncoder](https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder/encode) / [TextDecoder](https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder/decode)\n  * [DateView](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView)\n  * [text-encoding](https://github.com/inexorabletash/text-encoding)\n  * [TextEncoderLite (based on Buffer)](https://github.com/coolaj86/TextEncoderLite/tree/litest)\n  * [TextEncoderLite (based on text-encoding)](https://github.com/coolaj86/TextEncoderLite/tree/lite)\n  * [Beatgammit's base64-js](https://github.com/beatgammit/base64-js)\n\nQuick Note to Node.js Users\n------------------------\n\nYou SHOULD NOT use this module. You already have [`Buffer`](https://nodejs.org/api/buffer.html) and [`thirty-two`](https://github.com/chrisumbel/thirty-two):\n\n```javascript\nvar buf = new Buffer('I ½ ♥ 💩', 'utf8');\nbuf.toString('hex');\nbuf.toString('base64');\nbuf.toString('ascii');\nbuf.toString('utf8');\nbuf.toString('binary'); // deprecated, do not use\n```\n\nAPI\n===\n\n```javascript\n// TypedArray <--> UTF8\nvar uint8Array = Unibabel.strToUtf8Arr(str);\nvar str = Unibabel.utf8ArrToStr(uint8Array);\n\n// TypedArray <--> Base64\nvar base64 = Unibabel.arrToBase64(uint8Array)\nvar uint8Array = Unibabel.base64ToArr(base64)\n```\n\n**Normal APIs**\n\n`index.js`\n\n* utf8ToBuffer(utf8str) => array\n* bufferToUtf8(array) => string\n* utf8ToBase64(utf8str) => base64\n* base64ToUtf8(base64) => string\n* bufferToBase64(array) => base64\n* base64ToBuffer(base64) => array\n\n**Hex APIs**\n\n`unibabel.hex.js`\n\n* hexToBuffer(hexstr) => array\n* bufferToHex(array) => hexstr\n\n**Base32 APIs**\n\n`unibabel.base32.js`\n\n* base32ToBuffer(b32str) => array\n* bufferToBase32(array) => b32str\n\n**Helper APIs**\n\n* utf8ToBinaryString(utf8str) => binstr\n* binaryStringToUtf8(binstr) => utf8str\n* bufferToBinaryString(buffer) => binstr\n* binaryStringToBuffer(binstr) => array\n\nExamples\n========\n\n```javascript\n// Base64\n\nvar myArray = Unibabel.base64ToArr(\"QmFzZSA2NCDigJQgTW96aWxsYSBEZXZlbG9wZXIgTmV0d29yaw==\"); // \"Base 64 \\u2014 Mozilla Developer Network\"\nvar myBuffer = Unibabel.base64ToArr(\"QmFzZSA2NCDigJQgTW96aWxsYSBEZXZlbG9wZXIgTmV0d29yaw==\").buffer; // \"Base 64 \\u2014 Mozilla Developer Network\"\n\nconsole.log(myBuffer.byteLength);\n\n// Crazy Unicode\n\nvar sMyInput = \"I'm a ☢ ☃ that plays 𝄢 guitar and spea̧͈͖ks Ar̽̾̈́͒͑ ̶̧̨̱̹̭̯ͧ̾ͬC̷̙̲̝͖ͭ̏ͥͮ͟Oͮ͏̮̪̝͍M̲̖͊̒ͪͩͬ̚̚͜!\";\nvar aMyUTF8Input = Unibabel.strToUtf8Arr(sMyInput);\nvar sMyBase64 = Unibabel.arrToBase64(aMyUTF8Input);\n\nalert(sMyBase64);\n\nvar aMyUTF8Output = Unibabel.base64ToArr(sMyBase64);\nvar sMyOutput = Unibabel.utf8ArrToStr(aMyUTF8Output);\n\nalert(sMyOutput);\n```\n\nLicense\n=======\n\n* `index.js` and `unibabel.hex.js` are dual-licensed as Apache 2.0 and MIT.\n* `unibabel.base32.js` is a modified version of [thirty-two](https://github.com/chrisumbel/thirty-two) and is therefore licensed MIT.\n\nSome parts of the code were taken from MDN, which Mozilla has licensed in the Public Domain,\nwhich means that I am at liberty to re-license my copy under the Apache 2 and MIT licenses.\n\nSee <https://developer.mozilla.org/en-US/docs/MDN/About#Copyrights_and_licenses>\n\nChangeLog\n====\n\nv2.1.0\n------\n\nAdded `unibabel.base32.js`\n\nv2.0.0\n------\n\nThe new implementation is binary compatible with node.js, TextEncoder,\nand other more-common UTF-8 encodings.\n\nIt is also based on DOM APIs which result in much less code and are still\nbackwards compatible all the way back to IE6 (not on purpose, just that\nit happens to work).\n\nSee <https://coolaj86.com/articles/base64-unicode-utf-8-javascript-and-you/>\n\nv1.0.0\n------\n\nThis version was based on the work by good folks at the MDN, however,\nthe UTF-8 conversion was not byte-compatible with other UTF-8 conversions\n(such as node.js and TextEncoder), so don't use it.\nSee <https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding>\n","maintainers":[{"name":"danfinlay","email":"dan@danfinlay.com"}],"time":{"modified":"2022-06-13T05:11:14.341Z","created":"2016-12-20T17:58:31.485Z","2.1.3":"2016-12-20T17:58:31.485Z","3.0.0":"2016-12-20T18:10:36.924Z"},"homepage":"https://github.com/coolaj86/unibabel-js#readme","keywords":["ascii","binary","utf8","utf-8","ArrayBuffer","TypedArrays","TypedArray","Uint","Uint8Array","Base64","b64","Base32","b32"],"repository":{"type":"git","url":"git+https://github.com/coolaj86/unibabel-js.git"},"author":{"name":"AJ ONeal","email":"coolaj86@gmail.com","url":"http://coolaj86.com/"},"bugs":{"url":"https://github.com/coolaj86/unibabel-js/issues"},"license":"Apache-2.0","readmeFilename":"README.md"}