New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

create-data-uri

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

create-data-uri

Create a base64 data URI

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

create-data-uri Build Status

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

Keywords

data

FAQs

Package last updated on 16 Feb 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts