Skip to content

Instantly share code, notes, and snippets.

@arafathusayn
Created October 4, 2023 12:09
Show Gist options
  • Save arafathusayn/a6830484089716762ace69b06fcc4008 to your computer and use it in GitHub Desktop.
Save arafathusayn/a6830484089716762ace69b06fcc4008 to your computer and use it in GitHub Desktop.
Temp Fix for `bun install some-package@latest`
echo 'void async function() { const p = await Bun.file("package.json").json(); const out1 = Object.entries(p.dependencies).filter(([k,v]) => v === "latest").map(([k]) => k).reduce((acc, curr) => acc + " " +curr, "bun add"); const out2 = Object.entries(p.devDependencies).filter(([k,v]) => v === "latest").map(([k]) => k).reduce((acc, curr) => acc + " " +curr, "bun add -d"); console.log(`\n${out1}\n\n${out2}\n`) }()' > temp.js && bun run temp.js; rm temp.js
@arafathusayn
Copy link
Author

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment