1.0.5 • Published 11 months ago

generate-c2i v1.0.5

Weekly downloads
-
License
ISC
Repository
gitlab
Last release
11 months ago

c2i

Class Implementing Interface

This project is an NPM module that simplifies the process of generating classes that implement interfaces in project. It automates the generation of class files based on existing interface files and helps maintain consistency between the interface and class definitions.

Installation and Usage

To install and run the generate-c2i package, follow these steps:

Install the generate-c2i package using npm

npm i generate-c2i

Run the command in the terminal

npx generate-c2i <interfaceFolderPath> <classesFolderPath> <isConstructor?>

Arguments

The generate-c2i command accepts the following arguments:

  1. InterfaceFolderPath: The path of the folder containing interface files. This folder should exist in your Angular project's directory structure.
  2. ClassesFolderPath: The path of the folder where the generated class files will be saved. This folder will be created if it doesn't exist.
  3. Optional Boolean that generates the class files with constructor; default value is false

Output

The generate-c2i command will generate class files in the specified classesFolderPath based on the interfaces found in the interfaceFolderPath. The generated classes will implement the corresponding interfaces and maintain the same file names with a "Class" suffix.

Example

Here's an example of how to use the generate-c2i package:

npx generate-c2i ./src/app/shared/interfaces ./src/app/shared/classes true

This command will generate class files in the ./src/app/shared/classes folder based on the interfaces found in the ./src/app/shared/interfaces folder. The import statements in the generated classes with custom property.

Make sure to provide the correct paths to the interface and classes folders in your project for successful generation of class files.

Note

Please ensure that you have a backup of your code before running the c2i command, as it will modify your project by generating new class files based on the existing interfaces.

1.0.5

11 months ago

1.0.43

11 months ago

1.0.42

11 months ago

1.0.41

11 months ago

1.0.4

11 months ago

1.0.3

11 months ago

1.0.21

11 months ago

1.0.20

11 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago