ngast
Parsing tools for Angular. The project is an abstraction over the Angular compiler which provides friendly interface.
Last updated 2 months ago by grandschtroumpf .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install ngast 
SYNC missed versions from official npm registry.

Build Status

ngast

This library provides user friendly API for parsing Angular projects.

Getting started

$ npm i @angular/core @angular/compiler @angular/compiler-cli ngast --save

ngast is built on top of Ivy (ngtsc), make sure to compile your project with ngcc (run ng serve, ng build or npx ngcc).

Workspace

First you need connect the WorkspaceSymbols to the tsconfig.json root :

import { join } from 'path';
import { WorkspaceSymbols } from 'ngast';

const config = join(process.cwd(), 'tsconfig.json');
const workspace = new WorkspaceSymbols(config);

Then you can analyse your project. For that run analyzeAll:

workspace.analyzeAll();

The analysis is currently quite long: >10sec for a small project can go beyond 2min for a very large project.

From there you can find all the decorated classes in your project :

const modules = workspace.getAllModules();
const components = workspace.getAllComponents();
const directives = workspace.getAllDirectives();
const injectables = workspace.getAllInjectable();
const pipes = workspace.getAllPipes();

Note: If you don't analyze your project first, the first call to one of the methods above will run analysis.

Working without Ivy

Version 0.4.0 is built on top of the ViewEngine, you can take a look at the documentation here.

Example

Projects using ngast:

License

MIT

Current Tags

  • 0.5.0                                ...           latest (2 months ago)

39 Versions

  • 0.5.0                                ...           2 months ago
  • 0.4.0                                ...           8 months ago
  • 0.3.0                                ...           a year ago
  • 0.2.5                                ...           2 years ago
  • 0.2.4                                ...           2 years ago
  • 0.2.3                                ...           2 years ago
  • 0.2.2                                ...           2 years ago
  • 0.2.0                                ...           2 years ago
  • 0.1.4                                ...           3 years ago
  • 0.1.3                                ...           3 years ago
  • 0.1.2                                ...           3 years ago
  • 0.1.1                                ...           3 years ago
  • 0.1.0                                ...           3 years ago
  • 0.0.27                                ...           3 years ago
  • 0.0.26                                ...           4 years ago
  • 0.0.25                                ...           4 years ago
  • 0.0.24                                ...           4 years ago
  • 0.0.23                                ...           4 years ago
  • 0.0.22                                ...           4 years ago
  • 0.0.21                                ...           4 years ago
  • 0.0.20                                ...           4 years ago
  • 0.0.19                                ...           4 years ago
  • 0.0.18                                ...           4 years ago
  • 0.0.17                                ...           4 years ago
  • 0.0.16                                ...           4 years ago
  • 0.0.15                                ...           4 years ago
  • 0.0.14                                ...           4 years ago
  • 0.0.13                                ...           4 years ago
  • 0.0.12                                ...           4 years ago
  • 0.0.11                                ...           4 years ago
  • 0.0.10                                ...           4 years ago
  • 0.0.9                                ...           4 years ago
  • 0.0.8                                ...           4 years ago
  • 0.0.7                                ...           4 years ago
  • 0.0.6                                ...           4 years ago
  • 0.0.3                                ...           4 years ago
  • 0.0.2                                ...           4 years ago
  • 0.0.1                                ...           4 years ago
  • 0.0.0                                ...           4 years ago

Copyright 2014 - 2017 © taobao.org |