![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@namchee/decora
Advanced tools
Useful ECMAScript-compliant decorators to enhance JS (specifically, TypeScript) development experience
Useful ECMAScript decorator for personal purposes. Compatible with both browser and NodeJS environment.
Although it's written in TypeScript, these decorators should be compatible with normal JS files as long as it supports ES7.
Will be updated indefinitely.
npm install @namchee/decora
Remember to toggle the experimentalDecorators
option to true
in your tsconfig.json
Install @babel/plugin-proposal-decorators
and add it to your Babel configuration
@benchmark
Decorator Type: Method decorator
Add benchmarking functionality to a method from a class. Benchmark result will be written to console
.
Will transform the decorated function into an asynchronous function.
class Example {
@benchmark()
logMe() {
console.log('test');
}
}
Name | Required? | Values | Default Value | Description |
---|---|---|---|---|
metric | false | ['s', 'ms', 'ns'] | 'ms' | Metric to be used when logging function runtime |
precision | false | number, n > 1 | undefined | Number of digits after comma. Passing undefined will print an abruptly long string. |
stream | true | NodeJS.WritableStream | process.stdout | Destination for the log to be written to. Detailed Explanation. This option is ONLY available on NodeJS environment. |
@timeout
Decorator Type: Method decorator
Limits a function execution time to a certain time limit. Will throw an error if timeout value exceeded.
Will transform the decorated function into an asynchronous function.
class Example {
@benchmark(1000)
timeoutMe() {
setTimeoutPromise(5000); // will throw an error
}
}
Name | Required? | Values | Default Value | Description |
---|---|---|---|---|
time | true | number | - | Time limit for the function |
metric | false | ['s', 'ms', 'ns'] | 'ms' | Metric to be used when logging function runtime |
FAQs
Useful ECMAScript-compliant decorators to enhance JS (specifically, TypeScript) development experience
The npm package @namchee/decora receives a total of 2 weekly downloads. As such, @namchee/decora popularity was classified as not popular.
We found that @namchee/decora demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.