Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 6, 2024 via pnpm

data-uri-to-buffer 4.0.1

Generate a Buffer instance from a Data URI string
Package summary
Share
0
issues
1
license
1
MIT
Package created
3 Jan 2014
Version published
13 Jan 2023
Maintainers
1
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
data-uri-to-buffer@4.0.1
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of data-uri-to-buffer 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does data-uri-to-buffer do?

The "data-uri-to-buffer" module is a handy JavaScript tool designed to create an ArrayBuffer instance from a Data URI string. Data URIs are often used in web development to embed media data directly into documents, avoiding the need for external files. This module decode the "data" URI string and output an ArrayBuffer instance with the data. It works on a wide range of JavaScript runtimes, including Node.js and web browsers, making it a versatile tool for many projects.

How do you use data-uri-to-buffer?

For utilizing the functionality of the "data-uri-to-buffer" module, you first need to import the module. Following that, you can use the dataUriToBuffer() function which takes a "data" URI string as its argument and returns a decoded ArrayBuffer instance. For instance:

import { dataUriToBuffer } from 'data-uri-to-buffer';

// Plain-text data
let uri = 'data:,Hello%2C%20World!';
let parsed = dataUriToBuffer(uri);
console.log(new TextDecoder().decode(parsed.buffer));
// Outputs: 'Hello, World!'

// Base64-encoded data
uri = 'data:text/plain;base64,SGVsbG8sIFdvcmxkIQ%3D%3D';
parsed = dataUriToBuffer(uri);
console.log(new TextDecoder().decode(parsed.buffer));
// Outputs: 'Hello, World!'

The suite of data that dataUriToBuffer() function returns include type, typeFull, charset, and buffer.

Where are the data-uri-to-buffer docs?

The official documentation for "data-uri-to-buffer" is not specifically mentioned in the provided readme. However, for most npm packages like this, their documentation can usually be found on the package page on npmjs.com or on their GitHub repository. In this case, the GitHub URL for the package is git+https://github.com/TooTallNate/proxy-agents.git. Moreover, the readme content presented often serves as an initial or basic form of documentation.