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

@swc/wasm

Package Overview
Dependencies
Maintainers
2
Versions
614
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@swc/wasm

wasm module for swc

  • 1.9.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
552K
increased by8.45%
Maintainers
2
Weekly downloads
 
Created

What is @swc/wasm?

@swc/wasm is a high-performance JavaScript/TypeScript compiler written in Rust. It provides functionalities for transforming and minifying JavaScript and TypeScript code using WebAssembly (WASM). This package is particularly useful for developers looking to optimize their build processes and improve the performance of their web applications.

What are @swc/wasm's main functionalities?

Transforming JavaScript/TypeScript

This feature allows you to transform TypeScript code into JavaScript. The example code demonstrates how to transform a TypeScript snippet into ES2015 JavaScript using the @swc/wasm package.

const swc = require('@swc/wasm');

const inputCode = `const x: number = 42;`;

swc.transform(inputCode, { jsc: { parser: { syntax: 'typescript' }, target: 'es2015' } }).then(output => {
  console.log(output.code);
});

Minifying JavaScript

This feature allows you to minify JavaScript code. The example code demonstrates how to minify a simple JavaScript function using the @swc/wasm package.

const swc = require('@swc/wasm');

const inputCode = `function add(a, b) { return a + b; }`;

swc.minify(inputCode).then(output => {
  console.log(output.code);
});

Other packages similar to @swc/wasm

FAQs

Package last updated on 06 Nov 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