1.1.1 • Published 2 months ago
@master4n/decorators v1.1.1
@master4n/decorators
Installation
npm install @master4n/decorators
Usage
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.