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

@types/acorn

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/acorn

Stub TypeScript definitions entry for acorn, which provides its own types definitions

  • 6.0.4
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1.8M
increased by6.15%
Maintainers
1
Weekly downloads
 
Created

What is @types/acorn?

The @types/acorn package provides TypeScript type definitions for the Acorn JavaScript parser. It is useful for developers who use TypeScript and need type safety and IntelliSense support when working with Acorn.

What are @types/acorn's main functionalities?

Type Definitions for Acorn Parser

This code sample demonstrates how to use the @types/acorn package to provide type definitions when using the Acorn parser to parse a piece of JavaScript code. It sets up parser options with type safety and parses a simple script, logging the resulting AST.

import * as acorn from 'acorn';

const options: acorn.Options = {
  locations: true,
  ecmaVersion: 2020
};

const code = `let x = 10;`;
const ast = acorn.parse(code, options);
console.log(ast);

Other packages similar to @types/acorn

FAQs

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