Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

parse-data-uri

0.2.0 • Public • Published

parse-data-uri

parse a data uri into mime type and buffer

usage

var parseDataUri = require('parse-data-uri')
 
var dataUri = 'data:image/jpeg;base64,23423423...'
 
var parsed = parseDataUri(dataUri)
 
console.log(parsed)
// {
//   mimeType: 'image/jpeg',
//   data: Buffer < 00 00 00 ... > 
// }
 

api

parseDataUri : ( dataUri: String ) => {mimeType: String, data: Buffer}

installation

$ npm install parse-data-uri

running the tests

From package root:

$ npm install
$ npm test

Special thanks to @tootallnate for writing data-uri-to-buffer

contributors

license

ISC. (c) MMXIV jden jason@denizac.org. See LICENSE.md

install

npm i parse-data-uri

Downloadsweekly downloads

64,508

version

0.2.0

license

ISC

homepage

github.com

repository

Gitgithub

last publish

collaborators

    Report a vulnerability