@kezios/parse-data-uri
v1.1.0
Published
parse a data uri into mime type and buffer
Downloads
1
Readme
Parse Data Uri
Parse a data uri into mime type and buffer. Typescript version of junosuarez/node-parse-data-uri
with additionals data parsing.
Installation
yarn add @kezios/parse-data-uri
Usage
import parseDataUri from '@kezios/parse-data-uri'
const dataUri = 'data:image/jpeg;name=MyName.png;base64,23423423...'
const parsed = parseDataUri(dataUri)
console.log(parsed)
// {
// mimeType: 'image/jpeg',
// data: Buffer < 00 00 00 ... >,
// name: 'MyName'
// }
contributors
Special thanks to :
- @tootallnate for writing data-uri-to-buffer
- @jden for the original version parse-data-uri
license
ISC. (c) MMXIV jden [email protected]. See LICENSE.md