Git Product home page Git Product logo

ngast's Introduction

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);

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();

The first time one of the method above is called, ngast will run the analysis of the workspace.

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

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

ngast's People

Contributors

alexrashed avatar basvermeulen avatar cammisuli avatar chrisguttandin avatar dependabot[bot] avatar dherges avatar dmitryefimenko avatar grandschtroumpf avatar irustm avatar mgechev avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.