Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@ms-cloudpack/bundler
Advanced tools
This library provides an abstraction on bundling a package, assuming that the package is conformant.
Rather than directly depending on Webpack, rollup, or esbuild with large amounts of custom configuration, having an abstraction around bundling provides constraints around having common inputs/outputs.
This enforces the code follow consistent constraints, while also ensuring the output can be consumed in the browser or in node depending on supported environments.
Abstraction also allows us to use the right tool for the job. The right tool depends on priorities and capabilities. For dev builds we want the fastest tool, while for production we want optimal output. For library mode builds on commonjs only packages, esbuild doesn't emit named exports while rollup does. Maybe later esbuild will address that issue, so we can adjust the regulation logic accordingly.
async function bundlePackage(options)
import { bundlePackage } from '@ms-cloudpack/bundler';
async function start() {
const result = await bundlePackage({
packagePath: process.cwd(),
outputPath: path.join(process.cwd(), 'dist'),
outputType: 'library',
});
console.log(result);
}
start();
bundlePackage
optionsName | Type | Description |
---|---|---|
packagePath | string | Path to the package root where package.json lives. |
force | boolean | Bypasses the cache to create bundles. |
hashFrom | "package-version" | "git" | Determines how the cache key is computed for bundle results. |
output | "library" | "app" |
Name | Type | Description |
---|---|---|
stats | ||
outputMap |
The Cloudpack bundler abstraction is simple and constrained on purpose:
This library has only 2 output modes:
Entry points are discovered by analyzing the package.json. This ensures only explicit entries are bundled.
Under the hood, if we want to separate the process into multiple steps, we may consider using task helpers like just-scripts
or heft
to execute things in the right order. This might help
FAQs
An abstraction to bundle source code.
The npm package @ms-cloudpack/bundler receives a total of 557 weekly downloads. As such, @ms-cloudpack/bundler popularity was classified as not popular.
We found that @ms-cloudpack/bundler demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.