Socket
Socket
Sign inDemoInstall

acorn-node

Package Overview
Dependencies
Maintainers
40
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

acorn-node

the acorn javascript parser, preloaded with plugins for syntax parity with recent node versions


Version published
Weekly downloads
2.8M
increased by1.1%
Maintainers
40
Weekly downloads
 
Created

What is acorn-node?

The acorn-node package is an extension of the popular Acorn JavaScript parser, tailored specifically for Node.js environments. It includes additional support for parsing Node.js-specific syntax and features, making it an ideal choice for developers working on Node.js applications who need to analyze or manipulate JavaScript code programmatically.

What are acorn-node's main functionalities?

Parsing JavaScript

This feature allows you to parse a string of JavaScript code into an abstract syntax tree (AST), which can then be analyzed or manipulated. This is useful for tools that need to understand or transform JavaScript code.

const { parse } = require('acorn-node');
const AST = parse('const x = 1;');

Node.js Syntax Support

acorn-node extends Acorn to support Node.js-specific syntax, such as the `require` function. This makes it particularly useful for analyzing or transforming Node.js codebases.

const { parse } = require('acorn-node');
const AST = parse('require("path");', { ecmaVersion: 2020 });

Other packages similar to acorn-node

Keywords

FAQs

Package last updated on 13 Aug 2019

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