
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
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.
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:
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
| Structure | Long | Short |
|---|---|---|
| Class | a2g class NAME | a2g cl NAME |
| Component | a2g component NAME | a2g c NAME |
| Directive | a2g directive NAME | a2g d NAME |
| Enum | a2g enum NAME | a2g e NAME |
| Interface | a2g interface NAME | a2g i NAME |
| Module | a2g module NAME | a2g m NAME |
| Pipe | a2g pipe NAME | a2g p NAME |
| Service | a2g service NAME | a2g s NAME |
npm i -g a2g
or
yarn global add a2g
npm run build:dev
For production
npm run build:prod
npm test
npm run watch:test
FAQs
an extremely simple Angular 2 source code generator
We found that a2g demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.