Socket
Socket
Sign inDemoInstall

@kezios/parse-data-uri

Package Overview
Dependencies
1
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @kezios/parse-data-uri

parse a data uri into mime type and buffer


Version published
Weekly downloads
0
Maintainers
2
Install size
31.2 kB
Created
Weekly downloads
 

Readme

Source

Parse Data Uri

Parse a data uri into mime type and buffer. Typescript version of junosuarez/node-parse-data-uri with additionals data parsing.

Installation

yarn add @kezios/parse-data-uri

Usage

import parseDataUri from '@kezios/parse-data-uri'

const dataUri = 'data:image/jpeg;name=MyName.png;base64,23423423...'

const parsed = parseDataUri(dataUri)

console.log(parsed)
// {
//   mimeType: 'image/jpeg',
//   data: Buffer < 00 00 00 ... >,
//   name: 'MyName'
// }

contributors

Special thanks to :

  • @tootallnate for writing data-uri-to-buffer
  • @jden for the original version parse-data-uri

license

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

Keywords

FAQs

Last updated on 12 Apr 2022

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc