An open API service indexing awesome lists of open source software.

https://github.com/rokkit-ts/rokkit.ts-class-declaration-resolver

A Support Library for the Rokkit.ts Framework based on TypeScript and Node.js
https://github.com/rokkit-ts/rokkit.ts-class-declaration-resolver

backend dependency-injection framework microservice microservices nodejs rokkit typescript

Last synced: about 1 month ago
JSON representation

A Support Library for the Rokkit.ts Framework based on TypeScript and Node.js

Awesome Lists containing this project

README

          

# rokkit.ts-class-declaration-resolver

[![Build Status](https://travis-ci.com/rokkit-ts/rokkit.ts-class-declaration-resolver.svg?branch=master)](https://travis-ci.com/rokkit-ts/rokkit.ts-class-declaration-resolver)

Rokkit.ts Class declaration resolver is used to create class information that are not present on runtime. It is mainly used by the rokkit.ts-dependency-injection package.

## Install and Build

To install the package:

```bash
npm install @rokkit.ts/class-declaration-resolver
```

## Usage

The package is designed to retrieve class information about a user project/folder. The information contain data about
the file, the classes and the constructor parameters of this class.
The following example shows how to scan a project export and re-import the class information.

```typescript
import { ClassDeclarationResolver } from "@rokkit.ts/class-declaration-resolver";

ClassDeclarationResolver.createClassDeclarationFile(
"./sample-project",
"./config",
"declarations.json"
);

const declarations = ClassDeclarationResolver.importClassDeclarationFromFile(
"./config/declarations.json"
);
```

### API Description

| Class: | ClassDeclarationResolver |
| :------: | :------------------------------------------------------------------------------------------------------------ |
| Methods: | createClassDeclarations(scanningEntryPointPath: string) |
| | createClassDeclarationFile(scanningEntryPointPath: string, outDirPath: string, fileName: string) |
| | importClassDeclarationFromFile(filePath: string) |

## Contribution

All kinds of contributions are welcome, no matter how big or small.
Before you start to contribute please read our [Code of Conduct](./CODE_OF_CONDUCT.md).

In order to submit any contribution check out our [contribution guidelines](./CONTRIBUTION.md).

## License

Rokkit.ts-dependency-injection is Open Source software released under the MIT License.