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

@esbuild-kit/esm-loader

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@esbuild-kit/esm-loader

Node.js loader for compiling TypeScript modules to ESM

  • 2.6.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is @esbuild-kit/esm-loader?

@esbuild-kit/esm-loader is an npm package that allows you to use ES modules (ESM) in Node.js environments that do not natively support them. It leverages esbuild to transpile and load ESM code, making it easier to work with modern JavaScript syntax and features.

What are @esbuild-kit/esm-loader's main functionalities?

Transpile ESM to CommonJS

This feature allows you to import and use CommonJS modules in an ESM context. The code sample demonstrates how to use the `createRequire` function to require a CommonJS module in an ESM file.

import { createRequire } from 'module';
const require = createRequire(import.meta.url);
const { exampleFunction } = require('./example-file.js');
exampleFunction();

Load TypeScript files

This feature allows you to directly import and use TypeScript files in your Node.js project. The code sample shows how to import a TypeScript file and call a function from it.

import { exampleFunction } from './example-file.ts';
exampleFunction();

Support for JSX/TSX

This feature enables you to import and use JSX/TSX files in your Node.js project. The code sample demonstrates how to import a TSX file and render a React component.

import React from 'react';
import ReactDOM from 'react-dom';
import App from './App.tsx';

ReactDOM.render(<App />, document.getElementById('root'));

Other packages similar to @esbuild-kit/esm-loader

Keywords

FAQs

Package last updated on 17 Sep 2023

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