NPM Package Imports
NPM Package Imports
Section titled “NPM Package Imports”Bunmagic supports dynamic npm package imports without requiring prior installation.
Examples:
// Import and use packages directlyimport cowsay from 'cowsay'console.log(cowsay.say({ text: 'Hello!' }))
// Multiple packagesimport { marked } from 'marked'import chalk from 'chalk'
const html = marked('# Hello')console.log(chalk.blue(html))
Bun will automatically install the required packages the first time they’re imported.