# @villedemontreal/workit-core

> This package provides default and no-op implementations of the WorkIt types for client packages.

Latest version **7.0.3** (published 2026-08-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install @villedemontreal/workit-core
pnpm add @villedemontreal/workit-core
yarn add @villedemontreal/workit-core
bun add @villedemontreal/workit-core
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 7.0.3 |
| Published | 2026-08-10 |
| First published | 2021-07-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=20.6.0 |
| Dependencies | 8 |
| Unpacked size | 58.4 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 62 |
| Author | Montreal City Authors |
| Maintainers | psionikangel, olivieralbertini, sdriton, joscelynjean, steph-lebl, livetocode, electrotype, maudelaflamme |
| Keywords | Ville de Montreal, Typescript, open-telemetry, Worker |

## Links

- npm: https://www.npmjs.com/package/@villedemontreal/workit-core
- Repository: https://github.com/VilledeMontreal/workit
- Homepage: https://github.com/VilledeMontreal/workit#readme
- Issues: https://github.com/VilledeMontreal/workit/issues
- npm.io page: https://npm.io/package/@villedemontreal/workit-core

## Dependencies (8)

- [uuid](https://npm.io/package/uuid.md) ^14.0.1
- [debug](https://npm.io/package/debug.md) ~4.4.3
- [inversify](https://npm.io/package/inversify.md) 7.10.4
- [reflect-metadata](https://npm.io/package/reflect-metadata.md) ~0.2.2
- [@opentelemetry/api](https://npm.io/package/@opentelemetry/api.md) 1.9.0
- [@opentelemetry/core](https://npm.io/package/@opentelemetry/core.md) 2.2.0
- [fast-safe-stringify](https://npm.io/package/fast-safe-stringify.md) ~2.1.1
- [@villedemontreal/workit-types](https://npm.io/package/@villedemontreal/workit-types.md) ^7.0.3

## Recent versions

- 7.0.3 (latest) — 2026-08-10
- 7.0.2 — 2025-12-22
- 7.0.1 — 2025-10-28
- 7.0.0 — 2025-10-28
- 6.0.1 — 2025-10-24
- 6.0.0 — 2025-06-17
- 6.0.9-dev — 2025-05-26
- 6.0.8-dev — 2025-05-26
- 6.0.7-dev — 2025-05-10
- 6.0.6-dev — 2024-05-06
- 6.0.5-dev — 2024-04-29
- 6.0.4-dev — 2024-04-25
- 6.0.3-dev — 2024-02-28
- 6.0.2-dev — 2023-12-13
- 6.0.1-dev — 2023-12-13
- … 5 more at https://npm.io/package/@villedemontreal/workit-core/versions

## README

# WorkIt Core

[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)

This package provides default and no-op implementations of the WorkIt types for client packages.

```bash
npm i @villedemontreal/workit-core
```

## 🔌 Plugin System

WorkIt Core includes a powerful plugin system that allows you to extend worker functionality without modifying the core code. Plugins use dependency injection for seamless integration.

### Key Features
- **Extensible architecture** - Add custom functionality through plugins
- **Dynamic loading** - Enable/disable plugins at runtime
- **IoC integration** - Full access to the dependency injection container
- **Lifecycle management** - Automatic plugin loading/unloading
- **Configuration support** - Flexible plugin configuration

### Quick Example

```typescript
// Create a custom plugin
export class MyPlugin extends BasePlugin {
  public readonly moduleName = 'my-plugin';
  
  protected bind(): void {
    // Register your services in the IoC container
    this._ioc.bindTo(MyService, 'myService', new MyService());
  }
  
  protected unbind(): void {
    this._ioc.unbind('myService');
  }
}

// Configure and load plugins
const plugins: IPlugins = {
  'my-plugin': {
    enabled: true,
    path: './my-plugin'
  }
};

const pluginLoader = new PluginLoader(IoC, logger);
pluginLoader.load(plugins);
```

### Documentation & Examples
- **📖 [Complete Plugin Guide](docs/PLUGINS.md)** - Comprehensive documentation with API reference
- **🚀 [Metrics Plugin Example](../../../examples/plugin-metrics/)** - Full working example with metrics collection
- **🧪 [Plugin Tests](tests/units/pluginLoader.test.ts)** - Test examples and usage patterns

## Useful links
-   [Get started in 2 minutes](https://github.com/VilledeMontreal/workit/blob/master/packages/workit/.docs/WORKER.md).
-   [Documentation is available in this folder](https://github.com/VilledeMontreal/workit/tree/master/packages/workit/.docs)
-   Comprehensive API documentation is available [online](https://villedemontreal.github.io/workit/) and in the `docs` subdirectory

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