Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
use-object-url
Advanced tools
Readme
React Hook that receives an instance of File
, Blob
or MediaSource
and creates an URL representing it. It releases URL when component unmount or parameter changes.
import useObjectURL from 'use-object-url';
const DownloadFileLink = ({ file, filename }) => {
const fileURL = useObjectURL(file);
return (
<a href={fileURL} target="_blank" download={filename}>
Download
</a>
);
};
This library is published in the NPM registry and can be installed using any compatible package manager.
npm install use-object-url --save
# For Yarn, use the command below.
yarn add use-object-url
This module has an UMD bundle available through JSDelivr and Unpkg CDNs.
<!-- For UNPKG use the code below. -->
<script src="https://unpkg.com/use-object-url"></script>
<!-- For JSDelivr use the code below. -->
<script src="https://cdn.jsdelivr.net/npm/use-object-url"></script>
<script>
function PreviewImage(props) {
// UMD module is exposed through the "useObjectURL" function.
var imageURL = useObjectURL(props.uploadedImage);
return React.createElement('img', {
src: imageURL,
alt: 'Uploaded image',
title: 'Preview of uploaded image.'
});
}
</script>
Documentation generated from source files by Typedoc.
Released under MIT License.
FAQs
React Hook to create and revoke URL for any instance of `File`, `Blob` or `MediaSource`.
The npm package use-object-url receives a total of 115 weekly downloads. As such, use-object-url popularity was classified as not popular.
We found that use-object-url demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.