Decoratorsv0.1.3
@tekir/decorators
Generic decorator creation toolkit.
Installation
$
bun add @tekir/decoratorsFeatures
- setStatic() for class-level metadata
- pushToArray() and setInMap() for field decorators
- createFieldDecorator() and createMethodDecorator() factories
- createEventDecorator() for hook/event patterns
- compose() to combine multiple class decorators
Quick Example
TypeScript
import { pushToArray, setStatic } from '@tekir/decorators'
const Searchable = pushToArray('searchableFields')
const Cacheable = setStatic('cacheTtl')
@Cacheable(300)
class Post {
@Searchable() declare title: string
@Searchable() declare body: string
}Changelog
v0.1.3LatestSeptember 16, 2026
- Published output now uses the shared Node-targeted ESM bundle pipeline with external dependencies and generated TypeScript declarations, while Bun consumers keep the native source export.
v0.1.2July 23, 2026
- Package metadata now follows the shared compatible
0.1.xdependency range used by this coordinated Tekir release.
v0.1.1June 13, 2026
createEventDecoratornow handles instance methods instead of silently doing nothing: an instance method is registered against its constructor with a bound handler.composenow reverses a copy of the decorator list, so applying the same composed decorator to multiple classes is order-consistent (idempotent).- Found and fixed with Fable.
v0.1.0April 1, 2026
- Initial release