create-data-uri
v1.1.0
Published
Create a base64 data URI
Downloads
26
Readme
create-data-uri
Create a base64 data URI
Install
$ npm install --save create-data-uri
Usage
var createDataUri = require('create-data-uri')
createDataUri('image/jpeg', 'photo')
//=> data:image/jpeg;base64,photo
API
createDataUri(type, data)
-> string
type
Required
Type: string
/ object
The mime type for the data. You can optionally pass a {type, charset}
object as well.
data
Required
Type: string
Base64 encoded data.
License
MIT © Ben Drucker