Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
shaharkazaz committed Oct 24, 2024
1 parent cc2b5d5 commit 0643d9c
Showing 1 changed file with 38 additions and 12 deletions.
50 changes: 38 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,50 @@
<center>
<img width="300px" src="./logo-gradient.svg">
<h3>It sounds like a spell and works like a charm ✨</h3>
</center>
<div align="center">
<img width="300px" src="./logo-gradient.svg" alt="Letify Logo">
</div>

<h3 align="center">It sounds like a spell and works like a charm ✨</h3>

Letify CLI helps Angular developers to optimize their templates by reducing multiple async subscriptions to the same stream.
It identifies and suggests using the new `@let` syntax to avoid redundant observable subscriptions and improve performance.
<div align="center">
<a href="https://www.npmjs.com/package/@jsverse/letify">
<img src="https://img.shields.io/npm/v/@jsverse/letify.svg?style=flat-square" alt="npm version">
</a>
<a href="https://github.com/jsverse/letify/actions/workflows/ci.yml">
<img src="https://github.com/jsverse/letify/workflows/CI/badge.svg" alt="build status">
</a>
<a href="https://www.npmjs.com/package/@jsverse/letify">
<img src="https://img.shields.io/npm/dt/@jsverse/letify.svg?style=flat-square" alt="npm downloads">
</a>
<a href="https://github.com/jsverse/letify/blob/main/LICENSE">
<img src="https://img.shields.io/github/license/jsverse/letify.svg?style=flat-square" alt="license">
</a>
</div>

Letify CLI helps Angular developers optimize their templates by scanning your files and detecting multiple async subscriptions to the same stream.

### Usage
To get started, install Letify CLI:

```bash
npm i -D @jsverse/letify
```

Then, analyze your HTML files to identify redundant subscriptions:
```bash
npx letify analyze 'a/b.html' 'c/**/*.html' ...
```

#### CI / Lint-
Letify will return an error exit code if any duplicate subscriptions are detected in the specified files.
It can be seamlessly integrated into your [lint-staged](https://github.com/lint-staged/lint-staged) or CI workflows to
prevent duplicate subscriptions from being committed.

_Note_: Letify ignores commented code and does not analyze it.

### Options

* `-r, --reporter <type>`: Specifies the type of report to generate. Available options are:
* html: Generates an HTML report (default option).
* list: Provides a simple list of suggestions.
* json: Outputs the analysis in JSON format for programmatic use.
* `-o, --open`: Automatically opens the HTML report after it is generated (default `true`.
* `--verify-convention`: Verifies that stream names (observables) in the templates follow the convention of ending with a $ sign (default `false`).
* `-r, --reporter <type>`: Specifies the report format:
* `html` (default): Generates an HTML report.
* `list`: Outputs a simple list of suggestions.
* `json`: Provides a JSON report for programmatic use.
* `-o, --open`: Automatically opens the HTML report once generated (default `true`.
* `--verify-convention`: Checks that stream names (observables) in the templates follow the convention of ending with a `$` sign (default: `false`).

0 comments on commit 0643d9c

Please sign in to comment.