
Security News
TeamPCP and BreachForums Launch $1,000 Contest for Supply Chain Attacks
TeamPCP and BreachForums are promoting a Shai-Hulud supply chain attack contest with a $1,000 prize for the biggest package compromise.
@brika/plugin-timer
Advanced tools
Timer and countdown blocks for BRIKA workflows. Create delayed triggers, countdowns with progress, and time-based automation logic.
A one-shot timer that fires after a configured duration.
Inputs:
trigger (generic) — Starts the timer when data is receivedOutputs:
completed — Emits when timer finishes with { name, duration, triggeredAt, completedAt }Config:
name (string, optional) — Timer nameduration (duration) — How long to waitUsage:
blocks:
- id: start-timer
type: "@brika/plugin-timer:timer"
config:
name: "Break Reminder"
duration: 1800000 # 30 minutes in ms
- id: notify
type: "@brika/blocks-builtin:log"
config:
message: "Timer completed!"
connections:
- from: start-timer
fromPort: completed
to: notify
toPort: in
A countdown that emits progress ticks and completion/cancellation events.
Inputs:
start (generic) — Starts the countdowncancel (generic) — Cancels the countdownOutputs:
tick — Periodic progress: { remaining, total, progress }completed — When countdown finishes: { total }cancelled — When cancelled: { remaining }Config:
duration (duration) — Total countdown timetickInterval (duration, default: 1000) — Interval between ticksUsage:
blocks:
- id: countdown
type: "@brika/plugin-timer:countdown"
config:
duration: 60000 # 1 minute
tickInterval: 1000 # Update every second
- id: progress-log
type: "@brika/blocks-builtin:log"
config:
message: "{{ Math.round(inputs.in.progress * 100) }}% complete"
connections:
- from: countdown
fromPort: tick
to: progress-log
toPort: in
id: delayed-action
name: Delayed Action
enabled: true
blocks:
- id: clock
type: "@brika/blocks-builtin:clock"
config:
interval: 60000 # Check every minute
- id: timer
type: "@brika/plugin-timer:timer"
config:
name: "action-delay"
duration: 5000 # 5 second delay
- id: action
type: "@brika/blocks-builtin:log"
config:
message: "Delayed action executed!"
connections:
- from: clock
fromPort: tick
to: timer
toPort: trigger
- from: timer
fromPort: completed
to: action
toPort: in
id: countdown-demo
name: Countdown Demo
enabled: true
blocks:
- id: start
type: "@brika/blocks-builtin:clock"
config:
interval: 30000
- id: countdown
type: "@brika/plugin-timer:countdown"
config:
duration: 10000
tickInterval: 1000
- id: progress
type: "@brika/blocks-builtin:log"
config:
message: "Countdown: {{ inputs.in.remaining }}ms remaining"
level: debug
- id: done
type: "@brika/blocks-builtin:log"
config:
message: "Countdown complete!"
level: info
connections:
- from: start
fromPort: tick
to: countdown
toPort: start
- from: countdown
fromPort: tick
to: progress
toPort: in
- from: countdown
fromPort: completed
to: done
toPort: in
import { defineReactiveBlock, input, output, log, onStop, z } from "@brika/sdk";
export const timer = defineReactiveBlock(
{
id: "timer",
inputs: {
trigger: input(z.generic(), { name: "Trigger" }),
},
outputs: {
completed: output(
z.object({
name: z.string(),
duration: z.number(),
triggeredAt: z.number(),
completedAt: z.number(),
}),
{ name: "Completed" }
),
},
config: z.object({
name: z.string().optional().describe("Timer name"),
duration: z.duration(undefined, "Duration to wait"),
}),
},
({ inputs, outputs, config, log }) => {
let activeTimer: ReturnType<typeof setTimeout> | null = null;
inputs.trigger.on(() => {
if (activeTimer) clearTimeout(activeTimer);
const triggeredAt = Date.now();
const name = config.name ?? "timer";
log.info(`Timer "${name}" started for ${config.duration}ms`);
activeTimer = setTimeout(() => {
outputs.completed.emit({
name,
duration: config.duration,
triggeredAt,
completedAt: Date.now(),
});
activeTimer = null;
}, config.duration);
});
return () => {
if (activeTimer) clearTimeout(activeTimer);
};
}
);
onStop(() => log.info("Timer plugin stopping"));
log.info("Timer plugin loaded");
Add to your brika.yml:
install:
- ref: "workspace:timer"
enabled: true
Or install from npm:
install:
- ref: "npm:@brika/plugin-timer"
enabled: true
FAQs
Timer and countdown blocks for BRIKA workflows
We found that @brika/plugin-timer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
TeamPCP and BreachForums are promoting a Shai-Hulud supply chain attack contest with a $1,000 prize for the biggest package compromise.

Security News
Packagist urges PHP projects to update Composer after a GitHub token format change exposed some GitHub Actions tokens in CI logs.

Research
GemStuffer abuses RubyGems as an exfiltration channel, packaging scraped UK council portal data into junk gems published from new accounts.