Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
browser-file-downloader
Advanced tools
Download files with javascript
import axios from "axios";
import { download } from "browser-file-downloader";
const download = async (url: string, filename: string) => {
const { data } = await axios.get(url, {
responseType: "blob",
});
download(data, { filename });
};
interface DownloadOptions {
filename: string; // filename
mime?: string; // mime time (default: application/octet-stream) - required when using useDataUrl
bom?: BlobPart; // bom (bytes to include at the start of the file)
useDataUrl?: boolean; // whether to use the legacy data url instead of a blob url
}
If your CSVs are looking weird, you can try
import { download } from "browser-file-downloader";
let csvString = "";
const bom = "\uFEFF";
download(csvString, { filename: "data.csv", bom, useDataUrl: true, mime: "text/csv; charset=utf-8" });
const download = require("browser-file-downloader/dist/cjs/index.legacy.js");
download("My data", { filename: "file.txt" });
import { download } from "browser-file-downloader/dist/mjs/index.modern.js";
download("My data", { filename: "file.txt" });
FAQs
Download a file using javascript
The npm package browser-file-downloader receives a total of 0 weekly downloads. As such, browser-file-downloader popularity was classified as not popular.
We found that browser-file-downloader 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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.