arcane-os 0.1.0-dev.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +154 -0
- package/COMMERCIAL-LICENSE.md +13 -0
- package/LICENSE +661 -0
- package/NOTICE +70 -0
- package/README.md +448 -0
- package/bin/arcane-test.mjs +741 -0
- package/bin/arcane.mjs +5 -0
- package/docs/architecture.md +234 -0
- package/docs/compatibility.md +36 -0
- package/docs/event-manager.md +166 -0
- package/docs/platform-targets.md +108 -0
- package/docs/publishing.md +203 -0
- package/docs/reference/README.md +117 -0
- package/docs/reference/arcane-ollama.md +288 -0
- package/docs/reference/availability-and-normalization.md +123 -0
- package/docs/reference/behavioral-testing.md +86 -0
- package/docs/reference/cli.md +569 -0
- package/docs/reference/core/README.md +62 -0
- package/docs/reference/core/arcane-ai-contracts.md +873 -0
- package/docs/reference/core/arcane-api.md +601 -0
- package/docs/reference/core/arcane-entities.md +65 -0
- package/docs/reference/core/arcane-events.md +134 -0
- package/docs/reference/core/ollama-module.md +181 -0
- package/docs/reference/core/reference/arcane-api/ai-and-ollama.md +1909 -0
- package/docs/reference/core/reference/arcane-api/applications-terminal-capabilities.md +1057 -0
- package/docs/reference/core/reference/arcane-api/core-and-events.md +320 -0
- package/docs/reference/core/reference/arcane-api/filesystem-storage-preferences-appearance.md +610 -0
- package/docs/reference/core/reference/arcane-api/namespaces.md +1157 -0
- package/docs/reference/core/reference/arcane-api/platform-installation-users-system.md +1423 -0
- package/docs/reference/core/reference/arcane-api/session-provisioning-diagnostics-development.md +315 -0
- package/docs/reference/event-manager.md +957 -0
- package/docs/reference/inventory/package-api.json +2632 -0
- package/docs/reference/inventory/runtime-components.json +934 -0
- package/docs/reference/inventory/runtime-entities.json +26 -0
- package/docs/reference/inventory/runtime-modules.json +1249 -0
- package/docs/reference/protocols.md +242 -0
- package/docs/reference/runtime-components.md +1098 -0
- package/docs/reference/runtime-entities.md +303 -0
- package/docs/reference/runtime-modules.md +2010 -0
- package/docs/reference/sdk-api.md +4901 -0
- package/docs/roadmap.md +79 -0
- package/docs/work-amplification.md +124 -0
- package/node_modules/event-pubsub/CHANGELOG.md +55 -0
- package/node_modules/event-pubsub/MIGRATION.md +70 -0
- package/node_modules/event-pubsub/README.md +363 -0
- package/node_modules/event-pubsub/SECURITY.md +37 -0
- package/node_modules/event-pubsub/index.js +141 -0
- package/node_modules/event-pubsub/licence +21 -0
- package/node_modules/event-pubsub/package.json +59 -0
- package/node_modules/strong-type/README.md +408 -0
- package/node_modules/strong-type/assets/strong-type-header.png +0 -0
- package/node_modules/strong-type/index.js +1151 -0
- package/node_modules/strong-type/licence +21 -0
- package/node_modules/strong-type/node.js +125 -0
- package/node_modules/strong-type/package.json +61 -0
- package/package.json +95 -0
- package/runtime/ARCANE_RUNTIME_RELEASE.json +791 -0
- package/runtime/arcane/components/app-bar.html +468 -0
- package/runtime/arcane/components/assistant-panel.html +715 -0
- package/runtime/arcane/components/calculator.html +8 -0
- package/runtime/arcane/components/chart.html +655 -0
- package/runtime/arcane/components/chat.html +1225 -0
- package/runtime/arcane/components/conversation-view.html +13 -0
- package/runtime/arcane/components/dashboard-config.html +341 -0
- package/runtime/arcane/components/data-maintenance.html +112 -0
- package/runtime/arcane/components/data-view.html +92 -0
- package/runtime/arcane/components/directory-picker.html +197 -0
- package/runtime/arcane/components/document-inspector.html +252 -0
- package/runtime/arcane/components/file-drop.html +264 -0
- package/runtime/arcane/components/file-inspector.html +293 -0
- package/runtime/arcane/components/file-manager.html +1715 -0
- package/runtime/arcane/components/header.html +142 -0
- package/runtime/arcane/components/integration-settings.html +14 -0
- package/runtime/arcane/components/local-ai-status.html +360 -0
- package/runtime/arcane/components/markdown-document.html +1048 -0
- package/runtime/arcane/components/markdown-editor.html +360 -0
- package/runtime/arcane/components/media-embed.html +8 -0
- package/runtime/arcane/components/modal.html +402 -0
- package/runtime/arcane/components/output-panel.html +259 -0
- package/runtime/arcane/components/preferences-form.html +135 -0
- package/runtime/arcane/components/record-timeline.html +105 -0
- package/runtime/arcane/components/relationship-board.html +116 -0
- package/runtime/arcane/components/screen-capture.html +8 -0
- package/runtime/arcane/components/source-code-viewer.html +441 -0
- package/runtime/arcane/components/source-explanation.html +124 -0
- package/runtime/arcane/components/speech.html +365 -0
- package/runtime/arcane/components/summary-strip.html +177 -0
- package/runtime/arcane/components/table.html +77 -0
- package/runtime/arcane/components/task-progress.html +282 -0
- package/runtime/arcane/components/terminal-workspace.html +65 -0
- package/runtime/arcane/components/theme-editor.html +41 -0
- package/runtime/arcane/components/theme-switcher.html +46 -0
- package/runtime/arcane/components/unified-inbox.html +20 -0
- package/runtime/arcane/components/voice-transcription.html +476 -0
- package/runtime/arcane/components/weather-widget.html +8 -0
- package/runtime/arcane/components/web-navigator.html +239 -0
- package/runtime/arcane/css/communications.css +1 -0
- package/runtime/arcane/css/dashboard-config.css +45 -0
- package/runtime/arcane/css/document-site.css +981 -0
- package/runtime/arcane/css/layout.css +438 -0
- package/runtime/arcane/css/primitives.css +321 -0
- package/runtime/arcane/css/theme.css +112 -0
- package/runtime/arcane/css/utility-workspace.css +1 -0
- package/runtime/arcane/entities/ApiModelRecord.js +20 -0
- package/runtime/arcane/entities/Calculation.js +13 -0
- package/runtime/arcane/entities/Chat.js +581 -0
- package/runtime/arcane/entities/CommunicationMessage.js +29 -0
- package/runtime/arcane/entities/CommunicationThread.js +21 -0
- package/runtime/arcane/entities/Document.js +10 -0
- package/runtime/arcane/entities/File.js +143 -0
- package/runtime/arcane/entities/Image.js +135 -0
- package/runtime/arcane/entities/IntentEnvelope.js +834 -0
- package/runtime/arcane/entities/Preference.js +83 -0
- package/runtime/arcane/entities/TWiNPolicyDecision.js +1092 -0
- package/runtime/arcane/entities/TerminalSession.js +46 -0
- package/runtime/arcane/entities/Theme.js +107 -0
- package/runtime/arcane/entities/User.js +1046 -0
- package/runtime/arcane/entities/Weather.js +23 -0
- package/runtime/arcane/img/arcane-os-everywhere.png +0 -0
- package/runtime/arcane/img/arrow-left.png +0 -0
- package/runtime/arcane/img/arrow-right.png +0 -0
- package/runtime/arcane/img/doc.svg +5 -0
- package/runtime/arcane/img/folder.svg +4 -0
- package/runtime/arcane/img/image.svg +5 -0
- package/runtime/arcane/img/refresh.png +0 -0
- package/runtime/arcane/img/send.svg +9 -0
- package/runtime/arcane/img/trash.svg +5 -0
- package/runtime/arcane/img/upload.svg +5 -0
- package/runtime/arcane/modules/AI.js +2048 -0
- package/runtime/arcane/modules/AIPreferenceRuntime.js +32 -0
- package/runtime/arcane/modules/AIPreferenceTuple.js +92 -0
- package/runtime/arcane/modules/AIResponseLength.js +42 -0
- package/runtime/arcane/modules/AIResponseURLPolicy.js +626 -0
- package/runtime/arcane/modules/AnsiText.js +53 -0
- package/runtime/arcane/modules/ApiModelDatabase.js +25 -0
- package/runtime/arcane/modules/AppDataScope.js +245 -0
- package/runtime/arcane/modules/AppearancePreferences.js +28 -0
- package/runtime/arcane/modules/ArcaneCommunicationBridge.js +22 -0
- package/runtime/arcane/modules/ArcaneNavigationPolicy.js +135 -0
- package/runtime/arcane/modules/ArcaneNetworkPolicy.js +255 -0
- package/runtime/arcane/modules/AsyncBoundary.js +161 -0
- package/runtime/arcane/modules/BrowserTestSuite.js +326 -0
- package/runtime/arcane/modules/CalculatorEngine.js +20 -0
- package/runtime/arcane/modules/CaseEvidenceIndexer.js +134 -0
- package/runtime/arcane/modules/ChartLibrary.js +35 -0
- package/runtime/arcane/modules/ChatRecords.js +13 -0
- package/runtime/arcane/modules/CommunicationAppController.js +43 -0
- package/runtime/arcane/modules/CommunicationHub.js +16 -0
- package/runtime/arcane/modules/CommunicationPreferences.js +13 -0
- package/runtime/arcane/modules/CommunicationProviderRegistry.js +16 -0
- package/runtime/arcane/modules/ComponentContracts.js +586 -0
- package/runtime/arcane/modules/ConfiguredAIChatSession.js +288 -0
- package/runtime/arcane/modules/ConversationActionItems.js +488 -0
- package/runtime/arcane/modules/ConversationClosingReport.js +274 -0
- package/runtime/arcane/modules/ConversationTimebox.js +527 -0
- package/runtime/arcane/modules/CoreLocalModelCatalog.js +255 -0
- package/runtime/arcane/modules/DBLS.js +171 -0
- package/runtime/arcane/modules/DBOPFS.js +1154 -0
- package/runtime/arcane/modules/DBOPFSWorker.js +116 -0
- package/runtime/arcane/modules/DataMaintenance.js +91 -0
- package/runtime/arcane/modules/DevelopmentWorkspace.js +74 -0
- package/runtime/arcane/modules/DirectoryPicker.js +109 -0
- package/runtime/arcane/modules/DocumentNavigation.js +223 -0
- package/runtime/arcane/modules/Errors.js +1025 -0
- package/runtime/arcane/modules/GifEncoder.js +29 -0
- package/runtime/arcane/modules/HTMLImport.js +114 -0
- package/runtime/arcane/modules/InMemoryCommunicationProvider.js +14 -0
- package/runtime/arcane/modules/IsolatedModelQuestionRunner.js +275 -0
- package/runtime/arcane/modules/LocalAIReadiness.js +870 -0
- package/runtime/arcane/modules/LocalAIReadinessController.js +156 -0
- package/runtime/arcane/modules/MD.js +111 -0
- package/runtime/arcane/modules/Mail.js +352 -0
- package/runtime/arcane/modules/MailTransport.mjs +180 -0
- package/runtime/arcane/modules/Marked.min.js +71 -0
- package/runtime/arcane/modules/MemoryRecords.js +44 -0
- package/runtime/arcane/modules/MessageAdvisory.js +38 -0
- package/runtime/arcane/modules/ModelDefinition.js +189 -0
- package/runtime/arcane/modules/Ollama.js +74 -0
- package/runtime/arcane/modules/OllamaModelIdentifier.js +21 -0
- package/runtime/arcane/modules/OllamaSettings.js +24 -0
- package/runtime/arcane/modules/OpenMeteoWeatherProvider.js +14 -0
- package/runtime/arcane/modules/PreferenceStore.js +109 -0
- package/runtime/arcane/modules/QRCode.min.js +1 -0
- package/runtime/arcane/modules/Questionnaire.js +61 -0
- package/runtime/arcane/modules/RecordLinkIndex.js +24 -0
- package/runtime/arcane/modules/RecordPassageIndex.js +222 -0
- package/runtime/arcane/modules/RecordReviewStore.js +94 -0
- package/runtime/arcane/modules/RevocableProjectionLedger.js +1623 -0
- package/runtime/arcane/modules/RiskSignalAnalyzer.js +37 -0
- package/runtime/arcane/modules/ScamRiskPolicy.js +62 -0
- package/runtime/arcane/modules/ScopedOPFSCache.js +183 -0
- package/runtime/arcane/modules/ScreenCapture.js +20 -0
- package/runtime/arcane/modules/SpeechPlayback.js +581 -0
- package/runtime/arcane/modules/StaticDocumentCatalog.js +1248 -0
- package/runtime/arcane/modules/SystemAppearance.js +20 -0
- package/runtime/arcane/modules/SystemPlatformPresentation.js +51 -0
- package/runtime/arcane/modules/SystemToolRegistry.js +28 -0
- package/runtime/arcane/modules/TerminalClient.js +52 -0
- package/runtime/arcane/modules/TerminalCommandRegistry.js +50 -0
- package/runtime/arcane/modules/ThemeBootstrap.js +26 -0
- package/runtime/arcane/modules/ThemeManager.js +131 -0
- package/runtime/arcane/modules/TimeGuard.js +149 -0
- package/runtime/arcane/modules/ToolCallRouter.js +83 -0
- package/runtime/arcane/modules/WaitForComponent.js +102 -0
- package/runtime/arcane/modules/YouTubeMedia.js +16 -0
- package/runtime/arcane/modules/uPlot.LICENSE.txt +21 -0
- package/runtime/arcane/modules/uPlot.iife.min.js +2 -0
- package/runtime/arcane/modules/uPlot.min.css +1 -0
- package/runtime/arcane/security/arcane-network-policy.json +6 -0
- package/runtime/strong-type/index.js +352 -0
- package/runtime/strong-type/licence +21 -0
- package/runtime/strong-type/package.json +45 -0
- package/schemas/arcane-app-bundle.schema.json +125 -0
- package/schemas/arcane-app.schema.json +329 -0
- package/schemas/arcane-lock.schema.json +86 -0
- package/schemas/arcane-package.schema.json +224 -0
- package/schemas/cli-event.schema.json +122 -0
- package/schemas/event-stack.schema.json +152 -0
- package/schemas/native-build-plan.schema.json +176 -0
- package/schemas/target-adapter.schema.json +117 -0
- package/src/app-descriptor.mjs +500 -0
- package/src/cli/main.mjs +561 -0
- package/src/constants.mjs +31 -0
- package/src/dev-server.mjs +718 -0
- package/src/doctor.mjs +315 -0
- package/src/dom-event-instrumentation.mjs +594 -0
- package/src/errors.mjs +75 -0
- package/src/event-manager.mjs +1342 -0
- package/src/event-queue.mjs +138 -0
- package/src/events.mjs +219 -0
- package/src/index.mjs +177 -0
- package/src/integrated-provider-loader.mjs +432 -0
- package/src/native-plan.mjs +698 -0
- package/src/native-provider-loader.mjs +1126 -0
- package/src/packager/core.mjs +2691 -0
- package/src/process.mjs +353 -0
- package/src/release-bundle.mjs +2523 -0
- package/src/repository.mjs +90 -0
- package/src/runtime.mjs +452 -0
- package/src/scaffold.mjs +380 -0
- package/src/targets/index.mjs +436 -0
- package/src/templates/assets/app-icon.png +0 -0
- package/src/templates/workspace-template.mjs +388 -0
- package/src/testing-loader.mjs +9 -0
- package/src/testing.mjs +427 -0
- package/src/toolchain.mjs +1335 -0
- package/src/update-check.mjs +307 -0
- package/src/workspace.mjs +449 -0
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
# event-pubsub
|
|
2
|
+
|
|
3
|
+
[](https://github.com/RIAEvangelist/event-pubsub/actions/workflows/ci.yml)
|
|
4
|
+
[](https://github.com/RIAEvangelist/event-pubsub/releases)
|
|
5
|
+
[](https://www.npmjs.com/package/event-pubsub)
|
|
6
|
+
[](./package.json)
|
|
7
|
+
[](./package.json)
|
|
8
|
+
[](https://www.npmjs.com/package/strong-type)
|
|
9
|
+
[](https://www.npmjs.com/package/vanilla-test)
|
|
10
|
+
[](./licence)
|
|
11
|
+
|
|
12
|
+
[](https://riaevangelist.github.io/event-pubsub/reports/node/test-results.json)
|
|
13
|
+
[](https://riaevangelist.github.io/event-pubsub/reports/chrome/test-results.json)
|
|
14
|
+
|
|
15
|
+
[](https://riaevangelist.github.io/event-pubsub/reports/node/)
|
|
16
|
+
[](https://riaevangelist.github.io/event-pubsub/reports/node/)
|
|
17
|
+
[](https://riaevangelist.github.io/event-pubsub/reports/node/)
|
|
18
|
+
[](https://riaevangelist.github.io/event-pubsub/reports/node/)
|
|
19
|
+
|
|
20
|
+
[](https://riaevangelist.github.io/event-pubsub/reports/chrome/)
|
|
21
|
+
[](https://riaevangelist.github.io/event-pubsub/reports/chrome/)
|
|
22
|
+
[](https://riaevangelist.github.io/event-pubsub/reports/chrome/)
|
|
23
|
+
[](https://riaevangelist.github.io/event-pubsub/reports/chrome/)
|
|
24
|
+
|
|
25
|
+
Small, synchronous, extensible publish/subscribe events for modern Node.js and browsers.
|
|
26
|
+
|
|
27
|
+
> **Release status:** `6.1.0` is the current npm release and the verified source on `main`. `6.0.0` remains the most recent separately tagged GitHub source release.
|
|
28
|
+
|
|
29
|
+

|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
npm install event-pubsub
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
```js
|
|
36
|
+
import EventPubSub from 'event-pubsub';
|
|
37
|
+
|
|
38
|
+
const events = new EventPubSub();
|
|
39
|
+
|
|
40
|
+
events.on('ready', (payload) => {
|
|
41
|
+
console.log(payload);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
events.emit('ready', {fast: true});
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
The same source is available directly to CommonJS on Node.js 22.12 or newer:
|
|
48
|
+
|
|
49
|
+
```js
|
|
50
|
+
const EventPubSub = require('event-pubsub');
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Measured dispatch speed
|
|
54
|
+
|
|
55
|
+
[](https://riaevangelist.github.io/event-pubsub/benchmarks-dispatch.html)
|
|
56
|
+
|
|
57
|
+
Bars show median nanoseconds per emit, whiskers show p25–p75, and dots show all seven samples. Every rate is derived from the same execution-only measurement; setup, warmup, validation, verification, serialization, file I/O, and CI orchestration are excluded. Lower latency is better. Open the [interactive charts](https://riaevangelist.github.io/event-pubsub/benchmarks.html) or [raw schema v2 evidence](https://riaevangelist.github.io/event-pubsub/data/benchmark.json).
|
|
58
|
+
|
|
59
|
+
## Why this module
|
|
60
|
+
|
|
61
|
+
- Five fluent methods: `on`, `once`, `off`, `emit`, and `reset`.
|
|
62
|
+
- Synchronous, registration-order dispatch with wildcard subscribers first.
|
|
63
|
+
- One-shot subscribers are removed before invocation, including reentrant emits.
|
|
64
|
+
- Subscriber arrays remain live during an emit: additions can run in that emit, and specifically removed handlers are skipped before their turn. Removing a whole bucket or resetting the registry detaches it from future lookup while an already-active array finishes.
|
|
65
|
+
- Safe event names, including `__proto__`, `constructor`, and `toString`.
|
|
66
|
+
- Isolated `list` snapshots that cannot mutate the live registry.
|
|
67
|
+
- One native ESM source for browser imports plus Node.js `import` and `require()`, without transpilation or a duplicate CommonJS build.
|
|
68
|
+
- One explicit production validator: `strong-type` 2.0.0, loaded through the original Node/browser relative shim.
|
|
69
|
+
|
|
70
|
+
## API
|
|
71
|
+
|
|
72
|
+
| Member | Signature | Behavior |
|
|
73
|
+
| --- | --- | --- |
|
|
74
|
+
| `on` | `on(type, handler, once = false)` | Register a persistent or explicitly one-shot handler. |
|
|
75
|
+
| `once` | `once(type, handler)` | Register a handler removed immediately before its first call. |
|
|
76
|
+
| `off` | `off(type = '*', handler = '*')` | Remove every matching handler or a whole event type. |
|
|
77
|
+
| `emit` | `emit(type, ...payload)` | Run wildcard handlers, then typed handlers, synchronously. |
|
|
78
|
+
| `reset` | `reset()` | Clear the complete registry. |
|
|
79
|
+
| `list` | `get list()` | Return an isolated null-prototype object snapshot of handler arrays. |
|
|
80
|
+
|
|
81
|
+
All public mutators return the current instance. Event types must be strings, and `on`/`once` validate their handler immediately. For 5.x compatibility, `off` returns early for a missing type before validating its optional handler. Synchronous handler throws propagate to the publisher; return values and promises are ignored, so applications must handle asynchronous rejections themselves.
|
|
82
|
+
|
|
83
|
+
### Wildcard events
|
|
84
|
+
|
|
85
|
+
`*` subscribers run before typed subscribers and receive the emitted type as their first argument.
|
|
86
|
+
|
|
87
|
+
```js
|
|
88
|
+
events.on('*', (type, ...payload) => {
|
|
89
|
+
console.log(type, payload);
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
events.emit('invoice.paid', {id: 42});
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
The wildcard list entry is exposed at `Symbol.for('event-pubsub-all')`.
|
|
96
|
+
|
|
97
|
+
Only the exact public string `*` maps to the internal wildcard Symbol. The ordinary string `Symbol(event-pubsub-all)` remains an exact typed event name and never aliases wildcard removal.
|
|
98
|
+
|
|
99
|
+
### Browser import map
|
|
100
|
+
|
|
101
|
+
The 6.1.0 runtime imports `strong-type` 2.0.0 through `../strong-type/index.js`. This preserves the original package-shaped Node/browser layout: serve `event-pubsub` and `strong-type` as sibling package directories, then map only the public package name:
|
|
102
|
+
|
|
103
|
+
```html
|
|
104
|
+
<script type="importmap">
|
|
105
|
+
{
|
|
106
|
+
"imports": {
|
|
107
|
+
"event-pubsub": "./node_modules/event-pubsub/index.js"
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
</script>
|
|
111
|
+
<script type="module">
|
|
112
|
+
import EventPubSub from 'event-pubsub';
|
|
113
|
+
</script>
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Complete verification summary
|
|
117
|
+
|
|
118
|
+
The shared host-neutral registry contains **119 unique checks**. `vanilla-test` 2.1.1 executes the same inventory in Node and real Google Chrome.
|
|
119
|
+
|
|
120
|
+
| Suite | Cases | Focus |
|
|
121
|
+
| --- | ---: | --- |
|
|
122
|
+
| Unit | 16 | Exports, state, fluent identity, validation, and list shape |
|
|
123
|
+
| Functional | 26 | Registration, dispatch, wildcard, once, removal, reset, and chaining |
|
|
124
|
+
| Integration | 14 | Subclassing, routing, isolation, namespaces, lifecycle, and errors |
|
|
125
|
+
| Regression | 43 | Mutation, reentrancy, snapshots, safe names, throws, and registration-local once state |
|
|
126
|
+
| Interface | 20 | Playground parsing, safe display, bounded state, benchmark evidence, units, and chart scaling |
|
|
127
|
+
| **Total** | **119** | One registry used by direct tests and both coverage runtimes |
|
|
128
|
+
|
|
129
|
+
### Runtime and CI matrix
|
|
130
|
+
|
|
131
|
+
| Verification | Runtime | Hosts | Result requirement |
|
|
132
|
+
| --- | --- | --- | --- |
|
|
133
|
+
| Direct shared suite | Node 22.12.0 and Node 24 | Ubuntu, macOS, Windows | 119/119 on every matrix job |
|
|
134
|
+
| Node coverage | Node 24.18.0 | Ubuntu | 119/119 and every native V8 gate at 100% |
|
|
135
|
+
| Browser coverage | Google Chrome Stable | Ubuntu | 119/119 and every native V8 gate at 100% |
|
|
136
|
+
| Packed consumer | Node 24 | Ubuntu | Exact tarball contents, ESM exports, behavior, and the sole `strong-type` dependency |
|
|
137
|
+
| Shared-source package smoke | Node 22.12.0 | Ubuntu | The same packed `index.js` through ESM `import` and direct CommonJS `require()` |
|
|
138
|
+
| Execution benchmark | Node 24.18.0 | Ubuntu | Eight validated scenarios with execution-only timing boundaries |
|
|
139
|
+
| GitHub Pages | Node 24 | Ubuntu | 21 pages, both runtime reports, badges, benchmark JSON, scripts, links, and licenses |
|
|
140
|
+
|
|
141
|
+
### Coverage gates
|
|
142
|
+
|
|
143
|
+
| Runtime | Executable ranges | Block ranges | Function ranges | Executable lines |
|
|
144
|
+
| --- | ---: | ---: | ---: | ---: |
|
|
145
|
+
| Node 24.18.0 | 100% | 100% | 100% | 100% |
|
|
146
|
+
| Chrome Stable | 100% | 100% | 100% | 100% |
|
|
147
|
+
|
|
148
|
+
These are native V8 executable/block/function range and executable-line totals for `index.js`, not parser-derived Istanbul statement or branch counts. Node and Chrome produce independent HTML, JSON, LCOV, and normalized test-result artifacts.
|
|
149
|
+
|
|
150
|
+
### Commands
|
|
151
|
+
|
|
152
|
+
| Command | Purpose |
|
|
153
|
+
| --- | --- |
|
|
154
|
+
| `npm test` | Stage the sibling packages and run all 119 checks in Node. |
|
|
155
|
+
| `npm run test:unit` | Run the 16 Unit cases. |
|
|
156
|
+
| `npm run test:functional` | Run the 26 Functional cases. |
|
|
157
|
+
| `npm run test:integration` | Run the 14 Integration cases. |
|
|
158
|
+
| `npm run test:regression` | Run the 43 Regression cases. |
|
|
159
|
+
| `npm run test:interface` | Run the 20 Interface cases. |
|
|
160
|
+
| `npm run coverage` | Run all 119 checks independently in Node and real Chrome with 100% gates. |
|
|
161
|
+
| `npm run coverage:node` | Generate only the Node native V8 report. |
|
|
162
|
+
| `npm run coverage:chrome` | Generate only the real-Chrome native V8 report. |
|
|
163
|
+
| `npm run benchmark` | Record seven fixed-count latency samples for eight scenarios. |
|
|
164
|
+
| `npm run benchmark:smoke` | Validate the benchmark quickly without replacing published results. |
|
|
165
|
+
| `npm run test:package` | Pack, inspect, install, and exercise a clean consumer. |
|
|
166
|
+
| `npm run site:check` | Validate all focused pages, exact test inventories, scripts, links, forms, and assets. |
|
|
167
|
+
| `npm run verify` | Run the complete local release gate. |
|
|
168
|
+
|
|
169
|
+
### Published evidence
|
|
170
|
+
|
|
171
|
+
- [Testing strategy and suite totals](https://riaevangelist.github.io/event-pubsub/testing.html)
|
|
172
|
+
- [Live execution of all 119 checks](https://riaevangelist.github.io/event-pubsub/live.html)
|
|
173
|
+
- [Node test-result JSON](https://riaevangelist.github.io/event-pubsub/reports/node/test-results.json)
|
|
174
|
+
- [Chrome test-result JSON](https://riaevangelist.github.io/event-pubsub/reports/chrome/test-results.json)
|
|
175
|
+
- [Node HTML coverage](https://riaevangelist.github.io/event-pubsub/reports/node/)
|
|
176
|
+
- [Chrome HTML coverage](https://riaevangelist.github.io/event-pubsub/reports/chrome/)
|
|
177
|
+
- [Chrome coverage screenshot](https://riaevangelist.github.io/event-pubsub/reports/chrome/vanilla-test-chrome.png)
|
|
178
|
+
- [Execution-latency charts](https://riaevangelist.github.io/event-pubsub/benchmarks.html)
|
|
179
|
+
- [Raw benchmark schema v2 JSON](https://riaevangelist.github.io/event-pubsub/data/benchmark.json)
|
|
180
|
+
|
|
181
|
+
## Complete test inventory
|
|
182
|
+
|
|
183
|
+
Every test name below is sourced from the shared registry. The focused Pages site presents the same inventory one suite per page.
|
|
184
|
+
|
|
185
|
+
<details>
|
|
186
|
+
<summary><strong>Unit — 16 cases</strong></summary>
|
|
187
|
+
|
|
188
|
+
1. default and named exports reference the same class
|
|
189
|
+
2. a fresh instance exposes an empty list snapshot
|
|
190
|
+
3. instances own independent event registries
|
|
191
|
+
4. on returns the current instance
|
|
192
|
+
5. once returns the current instance
|
|
193
|
+
6. off returns the current instance when the type is absent
|
|
194
|
+
7. emit returns the current instance when the type is absent
|
|
195
|
+
8. reset returns the current instance
|
|
196
|
+
9. on requires a string event type
|
|
197
|
+
10. on requires a function handler
|
|
198
|
+
11. on requires a boolean once flag
|
|
199
|
+
12. once delegates type validation to on
|
|
200
|
+
13. once delegates handler validation to on
|
|
201
|
+
14. off requires a string event type
|
|
202
|
+
15. off validates a handler when the event exists
|
|
203
|
+
16. emit requires a string event type
|
|
204
|
+
|
|
205
|
+
</details>
|
|
206
|
+
|
|
207
|
+
<details>
|
|
208
|
+
<summary><strong>Functional — 26 cases</strong></summary>
|
|
209
|
+
|
|
210
|
+
1. on exposes the registered handler in list
|
|
211
|
+
2. on preserves registration order in list
|
|
212
|
+
3. duplicate registrations remain visible as separate entries
|
|
213
|
+
4. emit runs a registered handler synchronously
|
|
214
|
+
5. emit runs handlers in registration order
|
|
215
|
+
6. emit forwards every payload argument by identity
|
|
216
|
+
7. handlers run without an emitter-bound this value
|
|
217
|
+
8. once runs a handler exactly once
|
|
218
|
+
9. on with an explicit false once flag remains persistent
|
|
219
|
+
10. on with an explicit true once flag matches once
|
|
220
|
+
11. wildcard handlers receive the emitted type before payloads
|
|
221
|
+
12. wildcard handlers run before typed handlers
|
|
222
|
+
13. multiple wildcard handlers retain registration order
|
|
223
|
+
14. once supports wildcard subscriptions
|
|
224
|
+
15. wildcard handlers are exposed under the stable symbol
|
|
225
|
+
16. off removes a matching handler
|
|
226
|
+
17. off removes every duplicate registration of a handler
|
|
227
|
+
18. off leaves nonmatching handlers registered
|
|
228
|
+
19. off with a wildcard handler removes an event type
|
|
229
|
+
20. off defaults the handler argument to wildcard removal
|
|
230
|
+
21. off defaults the event type to wildcard subscriptions only
|
|
231
|
+
22. off removes one wildcard handler without touching typed handlers
|
|
232
|
+
23. reset removes typed and wildcard registrations
|
|
233
|
+
24. emitting an unknown type does not run other typed handlers
|
|
234
|
+
25. all public mutators support fluent chaining
|
|
235
|
+
26. the same function can be once and persistent independently
|
|
236
|
+
|
|
237
|
+
</details>
|
|
238
|
+
|
|
239
|
+
<details>
|
|
240
|
+
<summary><strong>Integration — 14 cases</strong></summary>
|
|
241
|
+
|
|
242
|
+
1. a subclass can publish state changes
|
|
243
|
+
2. multiple instances isolate same-named topics
|
|
244
|
+
3. namespaced topic strings remain exact
|
|
245
|
+
4. a wildcard audit stream observes several domains
|
|
246
|
+
5. a one-shot readiness gate coexists with persistent progress
|
|
247
|
+
6. a request-style payload preserves callbacks by identity
|
|
248
|
+
7. a handler can publish a second event synchronously
|
|
249
|
+
8. a wildcard handler can route selected events
|
|
250
|
+
9. reset provides a clean lifecycle boundary
|
|
251
|
+
10. empty and whitespace topic names remain distinct
|
|
252
|
+
11. unicode topic names and payloads pass through unchanged
|
|
253
|
+
12. async handlers are invoked without delaying synchronous peers
|
|
254
|
+
13. synchronous handler exceptions propagate to the publisher
|
|
255
|
+
14. list supports operational introspection without exposing records
|
|
256
|
+
|
|
257
|
+
</details>
|
|
258
|
+
|
|
259
|
+
<details>
|
|
260
|
+
<summary><strong>Regression — 43 cases</strong></summary>
|
|
261
|
+
|
|
262
|
+
1. `__proto__` is a safe event name
|
|
263
|
+
2. `constructor` is a safe event name
|
|
264
|
+
3. `toString` is a safe event name
|
|
265
|
+
4. `hasOwnProperty` is a safe event name
|
|
266
|
+
5. numeric-looking event names remain strings
|
|
267
|
+
6. the wildcard symbol description remains an exact typed event
|
|
268
|
+
7. off compares the remove-all handler sentinel strictly
|
|
269
|
+
8. emitting the literal wildcard type invokes wildcard handlers once
|
|
270
|
+
9. handlers added during typed dispatch run in that emit
|
|
271
|
+
10. typed handlers added by a wildcard run in that emit
|
|
272
|
+
11. wildcard handlers added during wildcard dispatch run in that emit
|
|
273
|
+
12. handlers removed during dispatch do not run later in that dispatch
|
|
274
|
+
13. a wildcard can remove a typed handler before the typed phase
|
|
275
|
+
14. reset during typed dispatch leaves the active array running
|
|
276
|
+
15. reset from a wildcard finishes that array but prevents typed dispatch
|
|
277
|
+
16. once is removed before a reentrant emit
|
|
278
|
+
17. persistent reentrant emits preserve nested registration order
|
|
279
|
+
18. wildcard once is removed before a reentrant emit
|
|
280
|
+
19. a throwing once handler remains removed
|
|
281
|
+
20. a throwing once handler is absent from the next list snapshot
|
|
282
|
+
21. a throwing persistent handler remains registered
|
|
283
|
+
22. a thrown wildcard handler stops typed dispatch
|
|
284
|
+
23. off with a nonmatching function preserves the type
|
|
285
|
+
24. off ignores an invalid handler when the type is absent
|
|
286
|
+
25. mutating a list array does not change the registry
|
|
287
|
+
26. deleting a list property does not change the registry
|
|
288
|
+
27. mutating a wildcard list snapshot does not change the registry
|
|
289
|
+
28. frozen handler functions can be registered
|
|
290
|
+
29. nonextensible handler functions can be registered
|
|
291
|
+
30. duplicate once registrations each run once
|
|
292
|
+
31. the same handler can be wildcard-once and typed-persistent
|
|
293
|
+
32. registration does not write the old once symbol onto handlers
|
|
294
|
+
33. the same handler can be once and persistent in one bucket
|
|
295
|
+
34. the same handler has independent state across instances
|
|
296
|
+
35. typed once removal does not skip the next registration
|
|
297
|
+
36. wildcard once removal does not skip the next registration
|
|
298
|
+
37. a sole once handler can add a handler to its live bucket
|
|
299
|
+
38. off all during dispatch leaves the active array running
|
|
300
|
+
39. stale once cleanup cannot delete a fresh same-name bucket
|
|
301
|
+
40. an earlier once remains consumed when a later handler throws
|
|
302
|
+
41. persistent self-removal preserves shifted-array iteration
|
|
303
|
+
42. wildcard-only emits remain chainable
|
|
304
|
+
43. reset instances accept new registrations immediately
|
|
305
|
+
|
|
306
|
+
</details>
|
|
307
|
+
|
|
308
|
+
<details>
|
|
309
|
+
<summary><strong>Interface — 20 cases</strong></summary>
|
|
310
|
+
|
|
311
|
+
1. the playground parses no-argument mode
|
|
312
|
+
2. the playground preserves one exact text argument
|
|
313
|
+
3. the playground parses an empty JSON argument array
|
|
314
|
+
4. the playground spreads several JSON arguments
|
|
315
|
+
5. invalid playground JSON is an explicit syntax error
|
|
316
|
+
6. a non-array JSON argument source is rejected
|
|
317
|
+
7. typed playground subscriptions preserve whitespace
|
|
318
|
+
8. wildcard playground subscriptions resolve to star
|
|
319
|
+
9. typed star subscriptions require wildcard mode
|
|
320
|
+
10. event-type display quotes invisible characters
|
|
321
|
+
11. safe value formatting exposes undefined
|
|
322
|
+
12. safe value formatting marks circular references
|
|
323
|
+
13. safe value formatting bounds long output
|
|
324
|
+
14. bounded timeline retention keeps chronological tail entries
|
|
325
|
+
15. benchmark evidence accepts all eight unique scenarios
|
|
326
|
+
16. benchmark evidence rejects the wrong schema version
|
|
327
|
+
17. benchmark evidence rejects duplicate or internally inconsistent scenarios
|
|
328
|
+
18. benchmark dispatch selection returns four scenarios
|
|
329
|
+
19. benchmark durations choose readable nanosecond and microsecond units
|
|
330
|
+
20. benchmark chart values clamp and expose equivalent throughput
|
|
331
|
+
|
|
332
|
+
</details>
|
|
333
|
+
|
|
334
|
+
## Benchmark interpretation
|
|
335
|
+
|
|
336
|
+
The benchmark reports median **execution latency**—nanoseconds per named operation—with p25, p75, min, max, and every raw sample. Fixed-count loops use exactly two `process.hrtime.bigint()` readings around the execution boundary. Dispatch scenarios use distinct minimal observable subscribers, then verify their accumulated effects after timing so empty callbacks cannot become an optimizer-only lower bound. Setup, validation, calibration, warmup, post-run checks, summary work, JSON serialization, file I/O, Node startup, and CI orchestration are excluded. The charts never present total benchmark or workflow duration as module execution time.
|
|
337
|
+
|
|
338
|
+
## Documentation
|
|
339
|
+
|
|
340
|
+
- [Overview](https://riaevangelist.github.io/event-pubsub/)
|
|
341
|
+
- [Guide](https://riaevangelist.github.io/event-pubsub/guide.html)
|
|
342
|
+
- [API](https://riaevangelist.github.io/event-pubsub/api.html)
|
|
343
|
+
- [Examples](https://riaevangelist.github.io/event-pubsub/examples.html)
|
|
344
|
+
- [Event console playground](https://riaevangelist.github.io/event-pubsub/playground.html)
|
|
345
|
+
- [Mutation playground scenarios](https://riaevangelist.github.io/event-pubsub/playground-scenarios.html)
|
|
346
|
+
- [All 119 tests](https://riaevangelist.github.io/event-pubsub/testing.html)
|
|
347
|
+
- [Node and Chrome coverage](https://riaevangelist.github.io/event-pubsub/coverage.html)
|
|
348
|
+
- [Benchmark overview](https://riaevangelist.github.io/event-pubsub/benchmarks.html)
|
|
349
|
+
- [Dispatch latency chart](https://riaevangelist.github.io/event-pubsub/benchmarks-dispatch.html)
|
|
350
|
+
- [Lifecycle latency charts](https://riaevangelist.github.io/event-pubsub/benchmarks-lifecycle.html)
|
|
351
|
+
- [Benchmark methodology](https://riaevangelist.github.io/event-pubsub/benchmarks-methodology.html)
|
|
352
|
+
- [5.x → 6.x migration](./MIGRATION.md)
|
|
353
|
+
- [Security policy](./SECURITY.md)
|
|
354
|
+
- [Changelog](./CHANGELOG.md)
|
|
355
|
+
|
|
356
|
+
## Runtime support
|
|
357
|
+
|
|
358
|
+
- Node.js 22.12.0 or newer for production, development, and direct CommonJS `require()` of the native ESM source.
|
|
359
|
+
- Modern browsers with native modules, private class fields, and `Symbol`. Unbundled use must serve the sibling `event-pubsub` and `strong-type` package directories.
|
|
360
|
+
|
|
361
|
+
## License
|
|
362
|
+
|
|
363
|
+
MIT. See [licence](./licence).
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Security policy
|
|
2
|
+
|
|
3
|
+
## Supported versions
|
|
4
|
+
|
|
5
|
+
| Version | Supported |
|
|
6
|
+
| --- | --- |
|
|
7
|
+
| 6.1.0 on npm | Current supported release |
|
|
8
|
+
| 6.0.0 | Superseded GitHub source release |
|
|
9
|
+
| 5.x and older | No planned security fixes |
|
|
10
|
+
|
|
11
|
+
Version 6.1.0 is the current npm release and requires Node.js 22.12 or newer. Version 6.0.0 remains available as the earlier GitHub source release, but users should install the latest available 6.x release.
|
|
12
|
+
|
|
13
|
+
## Reporting a vulnerability
|
|
14
|
+
|
|
15
|
+
Do not open a public issue for a suspected vulnerability. Use the repository's private [GitHub Security Advisory form](https://github.com/RIAEvangelist/event-pubsub/security/advisories/new).
|
|
16
|
+
|
|
17
|
+
Include:
|
|
18
|
+
|
|
19
|
+
- affected versions and runtimes;
|
|
20
|
+
- a minimal reproduction;
|
|
21
|
+
- expected and observed behavior;
|
|
22
|
+
- impact and realistic exploitation conditions; and
|
|
23
|
+
- any proposed mitigation.
|
|
24
|
+
|
|
25
|
+
Please allow reasonable time for triage and remediation before public disclosure.
|
|
26
|
+
|
|
27
|
+
## Trust model
|
|
28
|
+
|
|
29
|
+
event-pubsub synchronously invokes application-provided functions in the publisher's process and privilege context. It does not sandbox handlers, authorize event names, clone payloads, serialize data, catch synchronous throws, or observe returned promises. Applications are responsible for handling asynchronous rejections.
|
|
30
|
+
|
|
31
|
+
- Register only trusted code.
|
|
32
|
+
- Treat mutable payloads as shared references.
|
|
33
|
+
- Use `off` and `reset` at lifecycle boundaries so long-lived registries do not retain unnecessary closures or state.
|
|
34
|
+
- Add application-level authorization before publishing sensitive data across a shared hub.
|
|
35
|
+
- Isolate untrusted work in a process, worker, or other security boundary; an event emitter is not one.
|
|
36
|
+
|
|
37
|
+
Prototype-like event names are stored safely and covered by regression tests. This prevents object-prototype collisions but does not make arbitrary handler code safe.
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
// Shim allowing the same module path to run in Node and an unbundled browser.
|
|
2
|
+
import Is from '../strong-type/index.js';
|
|
3
|
+
|
|
4
|
+
const is = new Is();
|
|
5
|
+
const ALL_EVENTS = Symbol.for('event-pubsub-all');
|
|
6
|
+
|
|
7
|
+
function dispatchTyped(registrations, args) {
|
|
8
|
+
for (let index = 0; index < registrations.length;) {
|
|
9
|
+
const registration = registrations[index];
|
|
10
|
+
const handler = registration.handler;
|
|
11
|
+
|
|
12
|
+
if (registration.once) registrations.splice(index, 1);
|
|
13
|
+
else index += 1;
|
|
14
|
+
|
|
15
|
+
if (args.length === 0) handler();
|
|
16
|
+
else if (args.length === 1) handler(args[0]);
|
|
17
|
+
else if (args.length === 2) handler(args[0], args[1]);
|
|
18
|
+
else handler(...args);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function dispatchWildcard(registrations, type, args) {
|
|
23
|
+
for (let index = 0; index < registrations.length;) {
|
|
24
|
+
const registration = registrations[index];
|
|
25
|
+
const handler = registration.handler;
|
|
26
|
+
|
|
27
|
+
if (registration.once) registrations.splice(index, 1);
|
|
28
|
+
else index += 1;
|
|
29
|
+
|
|
30
|
+
if (args.length === 0) handler(type);
|
|
31
|
+
else if (args.length === 1) handler(type, args[0]);
|
|
32
|
+
else if (args.length === 2) handler(type, args[0], args[1]);
|
|
33
|
+
else handler(type, ...args);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
class EventPubSub {
|
|
38
|
+
#events = Object.create(null);
|
|
39
|
+
|
|
40
|
+
on(type, handler, once = false) {
|
|
41
|
+
is.string(type);
|
|
42
|
+
is.function(handler);
|
|
43
|
+
is.boolean(once);
|
|
44
|
+
|
|
45
|
+
const key = type === '*' ? ALL_EVENTS : type;
|
|
46
|
+
let registrations = this.#events[key];
|
|
47
|
+
if (registrations === undefined) registrations = this.#events[key] = [];
|
|
48
|
+
registrations.push({handler, once});
|
|
49
|
+
return this;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
once(type, handler) {
|
|
53
|
+
return this.on(type, handler, true);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
off(type = '*', handler = '*') {
|
|
57
|
+
is.string(type);
|
|
58
|
+
|
|
59
|
+
const key = type === '*' ? ALL_EVENTS : type;
|
|
60
|
+
const registrations = this.#events[key];
|
|
61
|
+
if (registrations === undefined) return this;
|
|
62
|
+
|
|
63
|
+
if (handler === '*') {
|
|
64
|
+
delete this.#events[key];
|
|
65
|
+
return this;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
is.function(handler);
|
|
69
|
+
|
|
70
|
+
let write = 0;
|
|
71
|
+
for (let read = 0; read < registrations.length; read += 1) {
|
|
72
|
+
const registration = registrations[read];
|
|
73
|
+
if (registration.handler === handler) continue;
|
|
74
|
+
if (write !== read) registrations[write] = registration;
|
|
75
|
+
write += 1;
|
|
76
|
+
}
|
|
77
|
+
registrations.length = write;
|
|
78
|
+
|
|
79
|
+
if (registrations.length === 0 && this.#events[key] === registrations) {
|
|
80
|
+
delete this.#events[key];
|
|
81
|
+
}
|
|
82
|
+
return this;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
emit(type, ...args) {
|
|
86
|
+
is.string(type);
|
|
87
|
+
|
|
88
|
+
const wildcard = this.#events[ALL_EVENTS];
|
|
89
|
+
if (wildcard !== undefined) {
|
|
90
|
+
const startedWithRegistrations = wildcard.length !== 0;
|
|
91
|
+
try {
|
|
92
|
+
dispatchWildcard(wildcard, type, args);
|
|
93
|
+
} finally {
|
|
94
|
+
if (
|
|
95
|
+
startedWithRegistrations &&
|
|
96
|
+
wildcard.length === 0 &&
|
|
97
|
+
this.#events[ALL_EVENTS] === wildcard
|
|
98
|
+
) {
|
|
99
|
+
delete this.#events[ALL_EVENTS];
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const typed = this.#events[type];
|
|
105
|
+
if (typed !== undefined) {
|
|
106
|
+
const startedWithRegistrations = typed.length !== 0;
|
|
107
|
+
try {
|
|
108
|
+
dispatchTyped(typed, args);
|
|
109
|
+
} finally {
|
|
110
|
+
if (
|
|
111
|
+
startedWithRegistrations &&
|
|
112
|
+
typed.length === 0 &&
|
|
113
|
+
this.#events[type] === typed
|
|
114
|
+
) {
|
|
115
|
+
delete this.#events[type];
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return this;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
reset() {
|
|
123
|
+
this.#events = Object.create(null);
|
|
124
|
+
return this;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
get list() {
|
|
128
|
+
const snapshot = Object.create(null);
|
|
129
|
+
for (const key of Reflect.ownKeys(this.#events)) {
|
|
130
|
+
snapshot[key] = this.#events[key].map(({handler}) => handler);
|
|
131
|
+
}
|
|
132
|
+
return snapshot;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
Object.defineProperties(EventPubSub, {
|
|
137
|
+
default: {value: EventPubSub},
|
|
138
|
+
EventPubSub: {value: EventPubSub}
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
export {EventPubSub as default, EventPubSub, EventPubSub as 'module.exports'};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 Brandon Nozaki Miller
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "event-pubsub",
|
|
3
|
+
"version": "6.1.0",
|
|
4
|
+
"description": "Small, synchronous, extensible publish/subscribe events for modern Node.js and browsers.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./index.js",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">=22.12.0"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"stage": "node ./scripts/stage-runtime.js",
|
|
12
|
+
"test": "npm run stage && node ./test-runtime/event-pubsub/test/node.js",
|
|
13
|
+
"test:unit": "npm run stage && node ./test-runtime/event-pubsub/test/node.js unit",
|
|
14
|
+
"test:functional": "npm run stage && node ./test-runtime/event-pubsub/test/node.js functional",
|
|
15
|
+
"test:integration": "npm run stage && node ./test-runtime/event-pubsub/test/node.js integration",
|
|
16
|
+
"test:regression": "npm run stage && node ./test-runtime/event-pubsub/test/node.js regression",
|
|
17
|
+
"test:interface": "npm run stage && node ./test-runtime/event-pubsub/test/node.js interface",
|
|
18
|
+
"coverage": "npm run stage && vanilla-test coverage all",
|
|
19
|
+
"coverage:node": "npm run stage && vanilla-test coverage node",
|
|
20
|
+
"coverage:chrome": "npm run stage && vanilla-test coverage chrome",
|
|
21
|
+
"benchmark": "npm run stage && node ./benchmark/run.js && node ./scripts/benchmark-chart.js",
|
|
22
|
+
"benchmark:smoke": "npm run stage && node ./benchmark/run.js --smoke",
|
|
23
|
+
"benchmark:chart": "node ./scripts/benchmark-chart.js",
|
|
24
|
+
"benchmark:chart:check": "node ./scripts/benchmark-chart.js --check",
|
|
25
|
+
"test:package": "node ./scripts/package-smoke.js",
|
|
26
|
+
"site:check": "npm run stage && npm run benchmark:chart:check && node ./scripts/site-check.js",
|
|
27
|
+
"site:assemble": "node ./scripts/assemble-site.js _site",
|
|
28
|
+
"site:deployment-check": "node ./scripts/deployment-check.js _site",
|
|
29
|
+
"start": "node ./scripts/serve.js",
|
|
30
|
+
"verify": "npm test && npm run coverage && npm run benchmark:smoke && npm run test:package && npm run site:check && npm run site:assemble && npm run site:deployment-check"
|
|
31
|
+
},
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "git+https://github.com/RIAEvangelist/event-pubsub.git"
|
|
35
|
+
},
|
|
36
|
+
"homepage": "https://riaevangelist.github.io/event-pubsub/",
|
|
37
|
+
"bugs": {
|
|
38
|
+
"url": "https://github.com/RIAEvangelist/event-pubsub/issues"
|
|
39
|
+
},
|
|
40
|
+
"funding": "https://github.com/sponsors/RIAEvangelist",
|
|
41
|
+
"keywords": [
|
|
42
|
+
"event",
|
|
43
|
+
"events",
|
|
44
|
+
"pubsub",
|
|
45
|
+
"publish-subscribe",
|
|
46
|
+
"event-emitter",
|
|
47
|
+
"node",
|
|
48
|
+
"browser",
|
|
49
|
+
"esm"
|
|
50
|
+
],
|
|
51
|
+
"author": "Brandon Nozaki Miller",
|
|
52
|
+
"license": "MIT",
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"strong-type": "2.0.0"
|
|
55
|
+
},
|
|
56
|
+
"devDependencies": {
|
|
57
|
+
"vanilla-test": "2.1.1"
|
|
58
|
+
}
|
|
59
|
+
}
|