← All @molecule/* packages · App templates

@molecule/api-activity-console

Provider bond · activity · API (Node) · v1.0.1 · Apache-2.0

Console activity sink for molecule.dev

npm install @molecule/api-activity-console

npm · Source on GitHub · Implements @molecule/api-activity

How it works

@molecule/api-activity-console is a provider bond on the API (Node) side: it implements the activity core interface (@molecule/api-activity) with a concrete vendor or library behind it.

Your code calls the core; you wire this provider once at startup. Swapping vendors later is one line in that wiring, not a rewrite.

import { setSink } from '@molecule/api-activity'
import { provider } from '@molecule/api-activity-console'

setSink(provider)

Works with: @molecule/api-activity, @molecule/api-logger

Reference

Auto-generated, AI-first package reference for the molecule.dev ecosystem. It is written to be read by coding agents as much as by people, and is generated from this package's source — edit src/index.ts JSDoc, not this file.

Console activity sink for molecule.dev.

Logs captured activity events via @molecule/api-logger. The default sink for standalone scaffolded apps.

Quick Start

import { setSink } from '@molecule/api-activity'
import { provider } from '@molecule/api-activity-console'

setSink(provider)

Type

provider

Installation

npm install @molecule/api-activity-console @molecule/api-activity @molecule/api-logger

API

Functions

createConsoleSink()

Creates a console activity sink that logs each event via the bonded logger.

function createConsoleSink(): ActivitySink

Returns: An {@link ActivitySink} that logs events and never throws.

Constants

provider

Default console activity sink instance.

const provider: ActivitySink

Core Interface

Implements @molecule/api-activity interface.

Bond Wiring

Setup function to register this provider with the core interface:

import { setSink } from '@molecule/api-activity'
import { provider } from '@molecule/api-activity-console'

export function setupActivityConsole(): void {
  setSink(provider)
}

Injection Notes

Requirements

Peer dependencies:

  • @molecule/api-activity ^1.0.1
  • @molecule/api-logger ^1.0.1

Runtime Dependencies

  • @molecule/api-activity
  • @molecule/api-logger