# mesh-decorators

> Custom decorators for Mesh IoC

Latest version **1.3.6** (published 2026-01-07) · ISC license · 0 weekly downloads

## Install

```sh
npm install mesh-decorators
pnpm add mesh-decorators
yarn add mesh-decorators
bun add mesh-decorators
```

## Health

**Score 60/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.3.6 |
| Published | 2026-01-07 |
| First published | 2024-04-04 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 11.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Boris Okunskiy |
| Maintainers | inca |
| Keywords | ioc, di, decorators |

## Links

- npm: https://www.npmjs.com/package/mesh-decorators
- Repository: https://github.com/MeshIoc/mesh-decorators
- Homepage: https://github.com/MeshIoc/mesh-decorators#readme
- Issues: https://github.com/MeshIoc/mesh-decorators/issues
- npm.io page: https://npm.io/package/mesh-decorators

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 1.3.6 (latest) — 2026-01-07
- 1.3.5 — 2026-01-07
- 1.3.4 — 2026-01-06
- 1.3.3 — 2026-01-03
- 1.3.2 — 2025-12-29
- 1.3.1 — 2025-12-29
- 1.3.0 — 2025-09-14
- 1.2.0 — 2025-09-14
- 1.1.2 — 2024-12-22
- 1.1.1 — 2024-12-22
- 1.1.0 — 2024-12-22
- 1.0.1 — 2024-04-19
- 1.0.0 — 2024-04-04

## README

# Mesh Decorators

Small framework for creating custom decorators for use with [Mesh IoC](https://github.com/MeshIoC/mesh-ioc).

## Usage

```ts
import { createMemberDecorator, findMembers, invokeMethods } from 'mesh-decorators';

// 1. Create a decorator to track "init" methods
const init = createMemberDecorator('init');

class FooService {

    // 2. Decorate members of the classes (can apply to methods and/or properties)
    @init()
    async setup() { /* ... */}

}

// 3. Bind the service(s) to a mesh
const mesh = new Mesh();
mesh.service(FooService);

// 4. Get all references to members decorated with @init
const initHandlers = findMembers('init', mesh);
// [{ target: <instance of FooService>, memberName: 'setup' }]

// 5. Invoke all @inmit methods
await Promise.all(invokeMethods('init', mesh));
```

## License

[ISC](https://en.wikipedia.org/wiki/ISC_license) © Boris Okunskiy

---
_Source: https://npm.io/package/mesh-decorators · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
