Socket
Socket
Sign inDemoInstall

@types/acorn

Package Overview
Dependencies
1
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

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


Version published
Weekly downloads
1.4M
decreased by-1.41%
Maintainers
1
Install size
457 kB
Created
Weekly downloads
 

Package description

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

Readme

Source

This is a stub types definition for @types/acorn (https://github.com/acornjs/acorn).

acorn provides its own type definitions, so you don't need @types/acorn installed!

FAQs

Last updated on 20 Jul 2022

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc