sosukesuzuki / angular-estree-parser

A parser that converts Angular source code into an ESTree-compatible form

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

angular-estree-parser

npm build coverage

A parser that converts Angular source code into an ESTree-compatible form

Changelog

Install

# using npm
npm install --save angular-estree-parser @angular/compiler

# using yarn
yarn add angular-estree-parser @angular/compiler

Usage

const ngEstreeParser = require('angular-estree-parser');

const ast = ngEstreeParser.parseBinding('a | b:c');
//=> { type: "NGPipeExpression", ... }

API

  • parseAction(input: string): AST for (target)="input"
  • parseBinding(input: string): AST for [target]="input"
  • parseInterpolation(input: string): AST for {{input}}
  • parseTemplateBindings(input: string): AST for *directive="input"

Development

# lint
yarn run lint

# build
yarn run build

# test
yarn run test

License

MIT © Ika

About

A parser that converts Angular source code into an ESTree-compatible form

License:MIT License


Languages

Language:TypeScript 98.5%Language:JavaScript 1.5%