Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

data-uri-regex

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

data-uri-regex

Regexp for data-uri

  • 0.1.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.2K
decreased by-5.86%
Maintainers
1
Weekly downloads
 
Created
Source

data-uri-regex Build Status

Regexp for data-uri

Install

$ npm install --save data-uri-regex

Usage

const dataUriRegex = require('data-uri-regex');

var png = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=='

png.match(dataUriRegex());
//=> true

dataUriRegex().test(png);
//=> true

dataUriRegex().exec(png)[1];
//=> 'data:'

dataUriRegex().exec(png)[2];
//=> 'image/png'

dataUriRegex().exec(png)[3];
//=> 'base64'

dataUriRegex().exec(png)[4];
//=> 'iVB'

API

dataUriRegex()

It will return the instance of RegExp() for match data-uri strings.

License

MIT © ragingwind

Keywords

FAQs

Package last updated on 16 Dec 2015

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc