Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
download-file-sync
Advanced tools
Ever wanted to write a node script that just downloads a file synchronously? I'm sure you sometimes wish you worked on PHP and just used file_get_contents('url')
. Yeah it's going to be slow, yeah it won't scale, but that doesn't matter for your little script.
npm install download-file-sync --save
var downloadFileSync = require('download-file-sync');
var content = downloadFileSync('https://github.com/vjeux/download-file-sync');
// '<!DOCTYPE html><html lang="en"...'
That's it, now you can get back to writing awesome prototypes ;)
Here's the full implementation:
module.exports = function(url) {
return require('child_process')
.execFileSync('curl', ['--silent', '-L', url], {encoding: 'utf8'});
}
As you can imagine, this is not web scale, but it works!
FAQs
Does exactly what you expects
The npm package download-file-sync receives a total of 1,662 weekly downloads. As such, download-file-sync popularity was classified as popular.
We found that download-file-sync 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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.