1.0.4 • Published 4 months ago
server-decorator v1.0.4
Server Decorator
A TypeScript library for server-side decorators.
Installation
To install the package, use npm or yarn:
npm install server-decorator
or
yarn add server-decorator
Usage
Importing the Decorators
import { cache, tracking } from 'server-decorator';
Example
Cache Decorator
import { cache } from 'server-decorator';
class ExampleService {
@cache()
getData() {
// Your implementation here
}
}
Tracking Decorator
import { tracking } from 'server-decorator';
class ExampleService {
@tracking()
trackData() {
// Your implementation here
}
}
Scripts
build
: Compiles the TypeScript code.test
: Runs the tests using Jest.publish-package
: Publishes the package to npm.
Running Tests
To run the tests, use the following command:
npm run test
or
yarn run test
Publishing
To publish the package, use the following command:
npm run publish-package
or
yarn run publish-package
Make sure you have configured your npm token in the .npmrc
file.
License
This project is licensed under the ISC License.