
Product
Socket Firewall Now Blocks Malicious VS Code and Open VSX Extensions
Socket Firewall blocks malicious VS Code and Open VSX extensions before install, protecting developers from compromised editor marketplaces.
easy-file-drop
Advanced tools
const { element, dragging } = useFileDrop(onFiles)
1. Here element is a ref, it should be attached to the element where the file will be dropped.
2. dragging is a boolean state | it is {true} while file is being dragged
3. onFile is a callback | (files:Array<File>)=>void | it will be triggered when even files are dropped on the attached element.
import useFileDrop from 'easy-file-drop';
import { useCallback, useState } from 'react';
function App() {
const [files,setFiles] = useState([])
const onFiles = useCallback(async(files)=>{
/** Do somethinng with the files here */
setFiles(files)
}, [])
const { element, dragging } = useFileDrop(onFiles)
return (
<div className="App" ref={element}>
<header className="App-header">
<ul>
{files.map(file=><li key={file.name}>{file.name}</li>)}
</ul>
{dragging?'Drop this file here':'Drag a file'}
</header>
</div>
);
}
export default App;
FAQs
Simplifies file drag and drop in react apps
The npm package easy-file-drop receives a total of 2 weekly downloads. As such, easy-file-drop popularity was classified as not popular.
We found that easy-file-drop 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.

Product
Socket Firewall blocks malicious VS Code and Open VSX extensions before install, protecting developers from compromised editor marketplaces.

Research
More than 140 Mastra npm packages were compromised in a supply chain attack that used a typosquatted dependency to deliver a cross-platform infostealer during installation.

Research
/Security News
A new npm package tests AI malware scanners with prompt injection, safety-triggering comments, context flooding, and obfuscated JavaScript.