Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/junosuarez/node-parse-data-uri
parse a data uri into mime type and buffer
https://github.com/junosuarez/node-parse-data-uri
Last synced: 8 days ago
JSON representation
parse a data uri into mime type and buffer
- Host: GitHub
- URL: https://github.com/junosuarez/node-parse-data-uri
- Owner: junosuarez
- License: isc
- Created: 2014-08-26T05:13:37.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2014-08-26T06:18:15.000Z (about 10 years ago)
- Last Synced: 2024-10-14T11:41:23.786Z (about 1 month ago)
- Language: JavaScript
- Size: 125 KB
- Stars: 5
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# parse-data-uri
parse a data uri into mime type and buffer## usage
```js
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 testSpecial thanks to @tootallnate for writing [data-uri-to-buffer](https://npm.im/data-uri-to-buffer)
## contributors
- jden
## license
ISC. (c) MMXIV jden . See LICENSE.md