
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
fetch-package-source
Advanced tools
Fetch the source code of a particular version of a package published to npm.
This does not download from npm as not all files might be published there. Therefore the source might be more useful to you, for example if you want to run its test suite.
const fetchPackageSource = require('fetch-package-source')
const { tmpdir } = require('os')
const dir = `${tmpdir()}/${Date.now()}`
await fetchPackageSource(
'https://github.com/juliangruber/browser-run',
'1.0.0',
dir
)
console.log(dir)
$ node example.js
/var/folders/h2/vg0v3hgn26x5gb4w64yx59zh0000gn/T/1577899257798
$ ls /var/folders/h2/vg0v3hgn26x5gb4w64yx59zh0000gn/T/1577899257798
README.md example.js index.js package.json test
This project is sponsored by CTO.ai, making it easy for development teams to create and share workflow automations without leaving the command line.
FAQs
Fetch a npm package's source code
We found that fetch-package-source 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.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.