Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@parcel/core

Package Overview
Dependencies
Maintainers
1
Versions
885
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@parcel/core

  • 2.0.0-canary.1652
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
446K
decreased by-4.67%
Maintainers
1
Weekly downloads
 
Created

What is @parcel/core?

@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.

What are @parcel/core's main functionalities?

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);
});

Other packages similar to @parcel/core

FAQs

Package last updated on 20 Jun 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc