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

oxc-parser

Package Overview
Dependencies
Maintainers
0
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

oxc-parser

Oxc Parser Node API

  • 0.31.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5.8K
decreased by-11.53%
Maintainers
0
Weekly downloads
 
Created
Source

The JavaScript Oxidation Compiler

See index.d.ts for parseSync and parseAsync API.

ESM

import assert from 'assert';
import oxc from 'oxc-parser';

function test(ret) {
  const program = JSON.parse(ret.program);
  assert(program.body.length == 1);
  assert(ret.errors.length == 0);
}

const sourceText = "let foo: Foo = 'foo';";
const options = {
  sourceFilename: 'text.tsx', // the extension is used to determine which dialect to parse
};

test(oxc.parseSync(sourceText, options));

async function main() {
  test(await oxc.parseAsync(sourceText, options));
}

main();

Keywords

FAQs

Package last updated on 08 Oct 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