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

acorn-es7-plugin

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

acorn-es7-plugin

A plugin for the Acorn parser that understands the ES7 keywords async and await

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
140K
increased by1.71%
Maintainers
1
Weekly downloads
 
Created
Source

NPM

acorn-es7-plugin

acorn-es7-plugin is a plugin for the Acorn parser that generates ESTrees following the 'experimental' specification for asynchronous functions.

npm install --save acorn-es7-plugin

Usage

Adding the plugin

// Require acorn as usual
var acorn = require("acorn");
// Add the es7-plugin
require('./acorn-es7-plugin')(acorn) ;

Using the plugin

var code = "async function x(){ return ; }\n";
code += "await x(1);" ;

var ast = acorn.parse(code,{
// Specify use of the plugin
	plugins:{asyncawait:true},
// Specify the ecmaVersion
	ecmaVersion:7
}) ;
// Show the AST
console.log(JSON.stringify(ast,null,2)) ;

Keywords

FAQs

Package last updated on 02 Oct 2015

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