1.1.5 • Published 1 year ago
@master4n/decorators v1.1.5
@master4n/decorators
Installation
npm install @master4n/decoratorsUsage
As a library
With CommonJS in JavaScript,
const { Value } = require("@master4n/decorators");With ESM or TypeScript,
import { Value } from "@master4n/decorators";class Token {
@Value("fix.token")
fixToken: string;
}Summary
This package contains decorators for any applications. Kindly set true for the below property in your tsconfig.json.
"experimentalDecorators": true,
"emitDecoratorMetadata": true,Available Decorators
| Decorator | Type | Description |
|---|---|---|
| Value | Class Property | Read the value from yaml file and assigned it to class property |
| GenerateID | Class Property | Assigne unique UUID value to class property |
| NotNull | Method Parameter | Check if parameter is not null and undefined |
| Counter | Static Property Parameter | Create static counter |
| Log | Method Parameter | Log in and out of method |
Credits
These definitions were written by Master4Novice.