- 🚀 Speed performance Inversion of control
- 🚨 Code Quality
- 🎇 Use Interface
- 🧪 Teste with 100% coverage
- Node.js 16 or later
- Yarn Optional/Recommended
- ODG Message
- ODG TsConfig Last Version
- ODG Exception Last Version
yarn add @odg/message @odg/axios axios
For simple example usage, you can use Inversify for Dependency Injection
import { type MessageInterface, type MessageResponse } from "@odg/message";
class Test {
public constructor(
private readonly requester: MessageInterface
) {
}
public async example(): Promise<MessageResponse<
unknown, // Reques Body
Record<string, unknown>, // Response Body
>> {
return this.requester.request({
url: "https://api.github.com/users/ODGodinho",
});
}
}
const test = new Test(new AxiosMessage({
// default options axios
}));
console.log(await test.example());
First install dependencies with the following command
yarn install
# or
npm install
To build the project, you can use the following command
if you change files, you need to run
yarn build
andyarn start
again
yarn build && yarn start
# or
yarn dev
To Test execute this command
yarn test
# or
yarn test:watch