{"name":"data-uri-to-buffer","version":"3.0.1","description":"Generate a Buffer instance from a Data URI string","main":"dist/src/index.js","types":"dist/src/index.d.ts","scripts":{"build":"tsc","test":"mocha --reporter spec dist/test/*.js","test-lint":"eslint src --ext .js,.ts","prepublishOnly":"npm run build"},"repository":{"type":"git","url":"git://github.com/TooTallNate/node-data-uri-to-buffer.git"},"engines":{"node":">= 6"},"keywords":["data","uri","datauri","data-uri","buffer","convert","rfc2397","2397"],"author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net","url":"http://n8.io/"},"license":"MIT","bugs":{"url":"https://github.com/TooTallNate/node-data-uri-to-buffer/issues"},"homepage":"https://github.com/TooTallNate/node-data-uri-to-buffer","devDependencies":{"@types/es6-promisify":"^5.0.0","@types/mocha":"^5.2.7","@types/node":"^10.5.3","@typescript-eslint/eslint-plugin":"1.6.0","@typescript-eslint/parser":"1.1.0","eslint":"5.16.0","eslint-config-airbnb":"17.1.0","eslint-config-prettier":"4.1.0","eslint-import-resolver-typescript":"1.1.1","eslint-plugin-import":"2.16.0","eslint-plugin-jsx-a11y":"6.2.1","eslint-plugin-react":"7.12.4","mocha":"^6.2.0","typescript":"^3.5.3"},"gitHead":"e39ad289e71726621466ba2cc7154a8eef452c23","_id":"data-uri-to-buffer@3.0.1","_nodeVersion":"12.16.2","_npmVersion":"6.14.5","dist":{"integrity":"sha512-WboRycPNsVw3B3TL559F7kuBUM4d8CgMEvk6xEJlOp7OBPjt6G7z8WMWlD2rOFZLk6OYfFIUGsCOWzcQH9K2og==","shasum":"594b8973938c5bc2c33046535785341abc4f3636","tarball":"http://registry-npm.ywwl.com/data-uri-to-buffer/download/data-uri-to-buffer-3.0.1.tgz","fileCount":5,"unpackedSize":8403,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe0a4iCRA9TVsSAnZWagAAmLMP/iFe6FQCzJsnZUR9OV0E\ndjQqRNjZ5bcvWxCtjGX51447SVX+2VffgQrU5YhvpOldRRo/FTAWWAydjek3\nzx1WGTEbWU1ozelnr6jRDw2PYKL/Ucr/ZRv5IMmoA40pN/8GjOxvI5OFNoCv\n19SOoqNGt750OSzixDEREBtpZiJzwQ6dODQX6gnj6C58qxsD3LlYFDkYNB2y\nPi6yz89Y6WmvwZK4b4shDUpkkLlypzThJ/3dz/P2QlqMqiy3gqR6ePl1w11M\nENz4aj24TMeymeugJpem008vwVffqFrY0kC1uZJN6c9D7bYPRvp1sbodGf2K\nUc19UHOlf8Q3b0C+aMD3xrxtGUBBZOv5ntuwYzQZKRklFXPeS7KuBR/2cguu\nftY/Qc4dPxq2zjuzCEZGQCnx0pdVHCCu7y1/G5all5TAHOrVkhuDAQOzIycD\nInW6Z2Zp+9GSkj03dpv4eQi5jTLrqz4l8/CfJu0YC3oNv40pAztWPA+ggNR+\niV2LUv9eFcebhFwE9xJagFhx0tIu5gif1fCQARPTbrYhBMssXBJFdn6qXVhR\nmjJvBgHd3D6xYRFBnN7UJOGiQDxb59fKorGkHELrXU0LjBuPgN4wl3OEdDDW\n8Du1Baksu2MtVpYocNfFrZp89tuxioGG5UoZIfW0X4RdLNQzAoesW3+sEwCQ\n2UTp\r\n=EmgN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCgfDFnQtnUEZckq8LbClI9lLwIeyvBljm6OkiSvFDecgIgX1mY9MMTFj0qTRkih5dYBDwFkeRK799CgQXjWK4Wq/o="}],"size":3503,"noattachment":false,"key":"/data-uri-to-buffer/-/data-uri-to-buffer-3.0.1.tgz"},"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"_npmUser":{"name":"tootallnate","email":"nathan@tootallnate.net"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/data-uri-to-buffer_3.0.1_1590799905558_0.6459117411174389"},"_hasShrinkwrap":false,"readme":"data-uri-to-buffer\n==================\n### Create an ArrayBuffer instance from a [Data URI][rfc] string\n\nThis module accepts a [\"data\" URI][rfc] String of data, and returns\nan `ArrayBuffer` instance with the decoded data.\n\nThis module is intended to work on a large variety of JavaScript\nruntimes, including Node.js and web browsers.\n\nExample\n-------\n\n```typescript\nimport { dataUriToBuffer } from 'data-uri-to-buffer';\n\n// plain-text data is supported\nlet uri = 'data:,Hello%2C%20World!';\nlet parsed = dataUriToBuffer(uri);\nconsole.log(new TextDecoder().decode(parsed.buffer));\n// 'Hello, World!'\n\n// base64-encoded data is supported\nuri = 'data:text/plain;base64,SGVsbG8sIFdvcmxkIQ%3D%3D';\nparsed = dataUriToBuffer(uri);\nconsole.log(new TextDecoder().decode(parsed.buffer));\n// 'Hello, World!'\n```\n\n\nAPI\n---\n\n```typescript\nexport interface ParsedDataURI {\n\ttype: string;\n\ttypeFull: string;\n\tcharset: string;\n\tbuffer: ArrayBuffer;\n}\n```\n\n### dataUriToBuffer(uri: string | URL) → ParsedDataURI\n\nThe `type` property gets set to the main type portion of\nthe \"mediatype\" portion of the \"data\" URI, or defaults to `\"text/plain\"` if not\nspecified.\n\nThe `typeFull` property gets set to the entire\n\"mediatype\" portion of the \"data\" URI (including all parameters), or defaults\nto `\"text/plain;charset=US-ASCII\"` if not specified.\n\nThe `charset` property gets set to the Charset portion of\nthe \"mediatype\" portion of the \"data\" URI, or defaults to `\"US-ASCII\"` if the\nentire type is not specified, or defaults to `\"\"` otherwise.\n\n*Note*: If only the main type is specified but not the charset, e.g.\n`\"data:text/plain,abc\"`, the charset is set to the empty string. The spec only\ndefaults to US-ASCII as charset if the entire type is not specified.\n\n[rfc]: http://tools.ietf.org/html/rfc2397\n","publish_time":1590799905700,"_cnpm_publish_time":1590799905700,"dist-tags":{"latest":"8.0.0"}}