PortablePosPrinterHamekara/node_modules/parse-data-uri
mehranz c2686e7110 initial commit 2025-11-15 13:33:50 +03:30
..
node_modules/data-uri-to-buffer initial commit 2025-11-15 13:33:50 +03:30
test initial commit 2025-11-15 13:33:50 +03:30
.npmignore initial commit 2025-11-15 13:33:50 +03:30
LICENSE.md initial commit 2025-11-15 13:33:50 +03:30
README.md initial commit 2025-11-15 13:33:50 +03:30
index.js initial commit 2025-11-15 13:33:50 +03:30
package.json initial commit 2025-11-15 13:33:50 +03:30

README.md

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