esnext-syntax-check

1.0.1 • Public • Published

esnext-syntax-check

A tool for checking esnext syntax

$ npm install -S esnext-syntax-check

Usage

const { checkEsnextSyntax } = require('esnext-syntax-check');
const source = 'function* gen(){}';

const result = checkEsnextSyntax(source); 
// => { 'generator function': 1 }

// with custom visitors, the visitors should return a string describing the syntax
const result2 = checkEsnextSyntax('export default 123; function* gen(){}', { ExportDefaultDeclaration: (path) => 'export default declaration' });
// => { 'custom: export default declaration': 1, 'export statement': 1, 'generator function': 1 }

Readme

Keywords

none

Package Sidebar

Install

npm i esnext-syntax-check

Weekly Downloads

1

Version

1.0.1

License

ISC

Unpacked Size

9.46 kB

Total Files

7

Last publish

Collaborators

  • stepped