
Security News
OWASP 2025 Top 10 Adds Software Supply Chain Failures, Ranked Top Community Concern
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.
bundle-import
Advanced tools
Bundle and load a file using the import-from-string.
Most of the code of Bundle-import comes from bundle-require. There is no objection to this, but Bundle-import does not generate temporary files when reading module contents, which can avoid conflicts with other tools. For example, the following two issues:
import.meta.urlnpm install bundle-import
import { bundleImport } from "bundle-import";
const { mod: mod1 } = await bundleImport({ filepath: "./fixtures/index.cjs", cwd: `${process.cwd()}/playground` });
console.log(mod1);
const { mod: mod2 } = await bundleImport({ filepath: "./playground/fixtures/index.mjs" });
console.log(mod2.default, mod2);
const { bundleImport } = require("bundle-import");
async function main() {
const { mod: mod1 } = await bundleImport({ filepath: "./fixtures/index.cjs", cwd: `${process.cwd()}/playground` });
console.log(mod1);
const { mod: mod2 } = await bundleImport({ filepath: "./playground/fixtures/index.mjs" });
console.log(mod2.default, mod2);
}
main();
Type: string
Default: process.cwd()
Project root directory.
Type: string
Required: true
The filepath to bundle and require.
Type: (string | RegExp)[]
Required: []
External packages.
Type: string
Required: tsconfig.json
A custom tsconfig path to read paths option.
Type: "cjs" | "esm"\
Provide bundle format explicitly to skip the default format inference.
Type: BuildOptions
Required: false
esbuild options.
MIT License © 2023-Present Condor Hero
FAQs
Bundle and load a file using the import-from-string.
The npm package bundle-import receives a total of 3,199 weekly downloads. As such, bundle-import popularity was classified as popular.
We found that bundle-import 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
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.