0.1.5 • Published 9 years ago

a2g v0.1.5

Weekly downloads
11
License
MIT
Repository
github
Last release
9 years ago

a2g - code file generation made easy!

This is a small project for generating skeleton code for various Angular 2 & TypeScript structures.

Actually, there's no need for such a tool as we already have angular-cli. Sadly, I couldn't use it because of some weird errors that were related to my current Angular 2 version.

However, I'd still recommend to use angular-cli as this little project is neither well designed nor very flexible.

Usage

Generating an Angular2 Component

a2g component foxtrott --dir ./some/dir

Result:

./some/dir:

       |-> foxtrott.component.ts
       |-> foxtrott.component.html
       |-> foxtrott.component.css
       |-> index.ts 

Generating an Angular 2 Service

a2g service unicorn --dir ./some/dir

Result:

./some/dir:

     | --> unicorn.service.ts

Generating a TypeScript Enum

a2g enum foxtrott --dir ./some/dir --opt unicorn, charlie, kilo

Result:

./some/dir:

         | --> charlie.ts 

Content of charlie.ts

export enum Foxtrott {
    Unicorn,
    Charlie,
    Kilo
}

Other possible structures are:

  • Angular 2 Directives
  • Angular 2 Modules
  • Angular 2 Pipes
  • TypeScript Interfaces
  • TypeScript Classes

If your structure (class, component etc.) should be written in PascalCase just use - to separate words.

Example:

a2g component foxtrott-unicorn-charlie-kilo

This will produce a component named FoxtrottUnicornCharlieKilo

Short commands

StructureLongShort
Classa2g class NAMEa2g cl NAME
Componenta2g component NAMEa2g c NAME
Directivea2g directive NAMEa2g d NAME
Enuma2g enum NAMEa2g e NAME
Interfacea2g interface NAMEa2g i NAME
Modulea2g module NAMEa2g m NAME
Pipea2g pipe NAMEa2g p NAME
Servicea2g service NAMEa2g s NAME

Installation

npm i -g a2g

or

yarn global add a2g

Building from source

npm run build:dev

For production

npm run build:prod

Tests

npm test

Continuous testing

npm run watch:test

License

MIT

0.1.5

9 years ago

0.1.4

9 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.10

10 years ago

0.0.9

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago