ProductPromotion
Logo

Angular.JS

made by https://0x3d.site

GitHub - angular-experts-io/ng-parsel: Parse your Angular code base to JSON abstraction - Great for displaying APIs and running custom analysis
Parse your Angular code base to JSON abstraction - Great for displaying APIs and running custom analysis - angular-experts-io/ng-parsel
Visit Site

GitHub - angular-experts-io/ng-parsel: Parse your Angular code base to JSON abstraction - Great for displaying APIs and running custom analysis

GitHub - angular-experts-io/ng-parsel: Parse your Angular code base to JSON abstraction - Great for displaying APIs and running custom analysis

ng-parsel

All Contributors

Coverage Status

Convert your Angular components to JSON

What is this module about

This module extracts the most important information of your Angular code base and converts it into JSON. Having the most important parts of your Angular code base as JSON can be very useful to perform custom analysis or to display APIs. Displaying APIs is especially useful for library authors that want to illustrate their library in a component showcase.

Getting started

Install

Install ng-parsel as a dev dependency in your repository.

npm i -D @angular-experts/ng-parsel

Init configuration

Once installed you can use npx to create an initial configuration for ng-parsel.

npx @angular-experts/ng-parsel init

Running this command will create a .parselrc.json configuration file in the root of your repository. Check the initial configuration and adjust if needed. The configuration properties and their meaning are explained in the configuration section.

Commands

Parse

To parse the code base you can either create a parse script in your package.jsonwhich calls ng-parsel or you can use npx.

Parse script

Add the following script to your package.json.

"parse": "@angular-experts/ng-parsel parse"

Once added, you can open up a terminal and run the following command.

npm run parse

NPX

To parse your code base with npx you can run the follwoing command inisde a terminal of your choice.

npx @angular-experts/ng-parsel parse

Configuration

ng-parsel offers the following configurations.

Property Default value Description
src 'src' Glob to query all the src files that should be parsed
out 'ng-parsel' Output directory
parseComponents true If set to true ng-parsel will parse Angular Components and include them in the output.
parseServices true If set to true ng-parsel will parse Angular Services and include them in the output.
parsePipes true If set to true ng-parsel will parse Angular Pipes and include them in the output.
parseDirectives true If set to true ng-parsel will parse Angular Directives and include them in the output.
parseModules true If set to true ng-parsel will parse Angular Modules and include them in the output.
parseHarnesses true If set to true ng-parsel will parse Harness test files (all files ending with .harness.ts) and include them in the output.
parseValidators true If set to true ng-parsel will parse Validators (all files ending with .validator.ts) and include them in the output.
parseSpecs true If set to true ng-parsel will parse testing files (all files ending with .spec.ts) and include them in the output.
singleFile true If set to to true the output will be written to a ng-parsel.json file in the output directory. If set to false, ng-parsel will generate multiple output files, one for each componentType. (Find out more on component types in the next section)

Stats

The stats command is a command that gives you a quick overview of your Angular application. It shows you how many components, services, pipes, directives, modules, harnesses and specs you have in your application. Furthermore, it shows you interesting insights, like how many are standanlone and how many are part of a module. To run the stats command you can either create a stats script in your package.jsonwhich calls ng-parsel or you can use npx;

Stats script

"stats": "@angular-experts/ng-parsel stats"

NPX

npx @angular-experts/ng-parsel stats

Types

Currently ng-parsel classifies each file into one of the following NgParselOutputType.

  • Component
  • Service
  • Pipes
  • Modules
  • Directives
  • Harnesses
  • Specs
  • Unknown

Unknown files will not be parsed. If you need support for additional types please raise an issue or open a PR.

Type detection

Harnesses, Specs and Validators are detected by the filename. Everything that ends with .spec will be classified as a spec file. Everything that ends with .harness will be classified as a harness file. Everything that ends with .validator will be classified as a validator file.

All other types are detected by their Angular decorators.

Outputs

Single outputs will be written to a ng-parsel.json file in the output directory. If singleFile is set to false ng-parsel will generate multiple output files, one for each componentType. (Find out more on component types)

Contributors

More Resources
to explore the angular.

mail [email protected] to add your project or resources here 🔥.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory