New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

a2g

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

a2g

an extremely simple Angular 2 source code generator

latest
Source
npmnpm
Version
0.1.5
Version published
Maintainers
1
Created
Source

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

Keywords

angular2

FAQs

Package last updated on 19 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts