anna-code-generator
v1.0.4
Published
Generator code files
Downloads
819
Readme
anna-code-generator
A tiny CLI that quickly generates a TypeScript class file with a ready-to-use instance export.
What It Does
When you run:
generate UserServiceThe tool creates a file named UserService.ts in the current directory with this content:
class UserService {
}
export const userService = new UserService();Installation
Global Installation
npm install -g anna-code-generatorAfter installation, both generate and generator commands are available in your terminal.
One-Time Usage With npx
npx anna-code-generator UserServiceUsage
generate <ClassName>Or:
generator <ClassName>Example:
generate ProductServiceOutput
- Creates
<ClassName>.tsin the directory where you run the command. - Generates a class with the provided name.
- Generates an exported instance with a lowercase first letter (for example,
ProductService->productService).
Notes
- The tool currently generates a basic skeleton only.
- Pass a valid class name (for example,
User,OrderService).
Troubleshooting (Windows)
If generator is not recognized:
- Close and reopen CMD or PowerShell after global install.
- Reinstall globally:
npm install -g anna-code-generator- Verify command shims:
where generator- Make sure this folder is in your
PATH:
C:\Users\<your-user>\AppData\Roaming\npm