Socket
Socket
Sign inDemoInstall

@swc/core-darwin-x64

Package Overview
Dependencies
0
Maintainers
2
Versions
431
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @swc/core-darwin-x64

Super-fast alternative for babel


Version published
Weekly downloads
1.7M
decreased by-1.31%
Maintainers
2
Created
Weekly downloads
 

Package description

What is @swc/core-darwin-x64?

@swc/core-darwin-x64 is a precompiled binary of the SWC (Speedy Web Compiler) core for macOS on x64 architectures. SWC is a super-fast compiler written in Rust that can be used to transpile JavaScript and TypeScript code to a lower version of JavaScript, enabling compatibility with older browsers or environments. It can also minify code and handle JSX for React applications.

What are @swc/core-darwin-x64's main functionalities?

JavaScript/TypeScript Transpilation

This feature allows you to transpile TypeScript or modern JavaScript to a compatible version for older browsers or environments. The code sample demonstrates how to transpile TypeScript code to ES5.

const swc = require('@swc/core-darwin-x64');

swc.transformSync('const x: number = 123;', {
  filename: 'input.ts',
  jsc: {
    parser: {
      syntax: 'typescript',
    },
    target: 'es5',
  }
});

Code Minification

This feature enables the minification of JavaScript code to reduce file size, which is beneficial for production environments. The code sample shows how to minify a simple JavaScript expression.

const swc = require('@swc/core-darwin-x64');

swc.transformSync('const x = 1 + 2;', {
  minify: true
});

JSX Handling

This feature is used to transform JSX syntax into JavaScript code that can be understood by browsers or other environments. The code sample demonstrates how to handle JSX for a React application.

const swc = require('@swc/core-darwin-x64');

swc.transformSync('<div>Hello, SWC!</div>', {
  jsc: {
    parser: {
      syntax: 'ecmascript',
      jsx: true
    },
    transform: {
      react: {
        pragma: 'React.createElement',
        pragmaFrag: 'React.Fragment',
        throwIfNamespace: true,
        development: false,
        useBuiltins: false
      }
    }
  }
});

Other packages similar to @swc/core-darwin-x64

Changelog

Source

[1.5.0] - 2024-04-24

Bug Fixes

  • (es/minifier) Abort seq inline on recursive usage (#8887) (cd4548f)

Features

Readme

Source

@swc/core-darwin-x64

This is the x86_64-apple-darwin binary for @swc/core

Keywords

FAQs

Last updated on 24 Apr 2024

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc