Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@parcel/core
Advanced tools
@parcel/core is a zero-configuration build tool for web applications. It provides a fast, scalable, and easy-to-use solution for bundling, transforming, and optimizing web assets.
Bundling
This code demonstrates how to use @parcel/core to bundle a web application starting from an entry HTML file. The bundler is configured with default settings and runs the build process.
const { Parcel } = require('@parcel/core');
const bundler = new Parcel({
entries: 'src/index.html',
defaultConfig: '@parcel/config-default'
});
bundler.run().then(() => {
console.log('Build completed!');
}).catch(err => {
console.error('Build failed:', err);
});
Transforming
This code shows how to use @parcel/core to transform a JavaScript file. The transformer is configured with default settings and processes the specified file.
const { Transformer } = require('@parcel/core');
const transformer = new Transformer({
filePath: 'src/app.js',
config: '@parcel/config-default'
});
transformer.transform().then(result => {
console.log('Transformation result:', result);
}).catch(err => {
console.error('Transformation failed:', err);
});
Optimizing
This code illustrates how to use @parcel/core to optimize a bundled JavaScript file. The optimizer is configured with default settings and processes the specified file.
const { Optimizer } = require('@parcel/core');
const optimizer = new Optimizer({
filePath: 'dist/bundle.js',
config: '@parcel/config-default'
});
optimizer.optimize().then(result => {
console.log('Optimization result:', result);
}).catch(err => {
console.error('Optimization failed:', err);
});
Webpack is a popular module bundler for JavaScript applications. It offers a highly configurable and extensible platform for bundling, transforming, and optimizing web assets. Compared to @parcel/core, Webpack requires more configuration but provides greater flexibility and control over the build process.
Rollup is a module bundler for JavaScript that focuses on producing smaller and faster bundles by leveraging ES6 modules. It is particularly well-suited for library development. Compared to @parcel/core, Rollup is more specialized and may require additional plugins for certain features.
Esbuild is an extremely fast JavaScript bundler and minifier. It is designed to be highly performant and can handle large codebases with ease. Compared to @parcel/core, esbuild is focused on speed and simplicity, but may lack some of the advanced features and integrations available in Parcel.
FAQs
Unknown package
The npm package @parcel/core receives a total of 365,940 weekly downloads. As such, @parcel/core popularity was classified as popular.
We found that @parcel/core demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.