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

esbuild-py

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

esbuild-py

Python bindings to the esbuild Transform API

  • 0.1.5
  • PyPI
  • Socket score

Maintainers
1

esbuild-py

PyPI Open In Colab

Python bindings to the esbuild Transform API.

Installation

pip install esbuild_py

Usage

from esbuild_py import transform

jsx = """
import * as React from 'react'
import * as ReactDOM from 'react-dom'

ReactDOM.render(
    <h1>Hello, world!</h1>,
    document.getElementById('root')
);
"""

print(transform(jsx))

API

transform

Parameters:

  • jsx (str) - The JSX string to be transformed.

Returns: str - The transformed JS as a string.

Development

Setup

Create conda environment

conda create -n esbuild-py python=3.11

Build

conda activate esbuild-py
go get github.com/keller-mark/esbuild-py
# go build -buildmode=c-shared -o _esbuild.so

Develop

Build python package and install in editable mode

python setup.py bdist_wheel
python setup.py sdist
pip install -e .

Publish

Increment the version in pyproject.toml. The cibuildwheel GH action will build wheels for a matrix of Python versions, OS, and architectures. Then, GH actions will publish to PyPI.

Resources

Keywords

FAQs


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