Socket
Socket
Sign inDemoInstall

es-module-lexer

Package Overview
Dependencies
Maintainers
1
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

es-module-lexer

Lexes ES modules returning their import/export metadata


Version published
Weekly downloads
22M
decreased by-2.15%
Maintainers
1
Weekly downloads
 
Created

What is es-module-lexer?

The es-module-lexer package is designed to perform lexical analysis of JavaScript modules to identify import and export statements. It is particularly useful for tools that need to analyze or transform ES module syntax, such as bundlers, compilers, and code analysis tools.

What are es-module-lexer's main functionalities?

Lexical Analysis

This feature allows you to perform lexical analysis on a string containing ES module source code. The `parse` function returns two arrays: one for the import statements and one for the export statements found in the source code.

import { init, parse } from 'es-module-lexer';

(async () => {
  await init;
  const source = `import { a } from 'module-a';`;
  const [imports, exports] = parse(source);
  console.log(imports);
  console.log(exports);
})();

Other packages similar to es-module-lexer

FAQs

Package last updated on 16 May 2020

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