# astral-angular-annotate

> AngularJS DI annotation pass for astral

Latest version **0.0.2** (published 2013-07-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install astral-angular-annotate
pnpm add astral-angular-annotate
yarn add astral-angular-annotate
bun add astral-angular-annotate
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2013-07-02 |
| First published | 2013-06-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Brian Ford |
| Maintainers | btford |
| Keywords | astral, angular |

## Links

- npm: https://www.npmjs.com/package/astral-angular-annotate
- Repository: https://github.com/btford/astral-angular-annotate
- Issues: https://github.com/btford/astral-angular-annotate/issues
- npm.io page: https://npm.io/package/astral-angular-annotate

## Dependencies (2)

- [clone](https://npm.io/package/clone.md) ~0.1.9
- [astral-pass](https://npm.io/package/astral-pass.md) ~0.1.0

## Recent versions

- 0.0.2 (latest) — 2013-07-02
- 0.0.1 — 2013-06-05

## README

# Astral Angular Annotator

A pass for [Astral](https://github.com/btford/astral) to generate [AngularJS](http://angularjs.org) [DI annotations](TODO: find docs) automatically.

For a tool CLI, see `[ngmin](TODO: link).

## Usage

Below is an example parsing, annotating, and generating JavaScript code. Note that this requires the `esprima`, `escodegen`, `astral`, and `astral-angular-annotator` npm packages.

```javascript
var esprima = require('esprima'),
  escodegen = require('escodegen'),
  astral = require('astral')();

// register angular annotator pass
require('astral-angular-annotator')(astral);

var inputCode = "angular.module('myMod').controller('FooCtrl', function ($scope) {" +
"  // ..." +
"});";

var ast = esprima.parse(inputCode, {
  tolerant: true
});

astral.run(ast);

var generatedCode = escodegen.generate(ast, {
  format: {
    indent: {
      style: '  '
    }
  }
});

console.log(generatedCode);

// logs:
//
// angular.module('myMod').controller('FooCtrl', ['$scope', function ($scope) {
//   // ...
// });

```

## API

You can also access each of the individual passes like this:

```

```

This might be handy for more fine-tuned control.

## License
MIT

---
_Source: https://npm.io/package/astral-angular-annotate · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
