npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@tryjoy/dokidoki

v1.0.5

Published

CLI tool for BLE device control with motion scripts and audio playback

Readme

dokidoki

Control your interactive device from the terminal.

A Node.js CLI tool for controlling BLE devices with timeline-based playback, featuring background daemon for persistent connections and audio synchronization.

Features

  • 🎵 Timeline Playback - Play device actions synchronized with audio files
  • 🔄 Background Daemon - Persistent BLE connection, playback continues after CLI exits
  • ⏸️ Play/Pause/Resume - Full playback control with automatic device stop
  • 🎮 Direct Control - Set linear, rotary, vibration, and suction values directly
  • 🔌 BLE Management - Scan, connect, disconnect devices
  • 🎧 Audio Formats - MP3, AAC/M4A, WAV, FLAC, OGG, AIFF

Installation

npm install -g @tryjoy/dokidoki

Quick Start

# Start the background daemon
doki start

# Scan for devices
doki scan

# Connect to device
doki connect DK-META2

# Play timeline with audio (runs in background)
doki player play song.mp3 timeline.json

# Control playback
doki player pause    # Pause and stop device
doki player resume   # Resume playback

# Stop all device actions immediately
doki action pause

# Check status
doki status

# Stop daemon
doki stop

Commands

Daemon Management

doki start              # Start background daemon
doki stop               # Stop background daemon
doki status             # Check daemon and connection status

Device Connection

doki scan               # Scan for BLE devices
doki connect [name]     # Connect to device (default: DK-META2)
doki disconnect         # Disconnect from device

Timeline Playback

doki player play [audio.mp3] <timeline.json>   # Play timeline
doki player pause                               # Pause (stops device)
doki player resume                              # Resume playback

Direct Device Control

doki action linear 50      # Set linear to 50%
doki action rotary -- -30  # Set rotary to -30 (reverse)
doki action vibration 80   # Set vibration to 80%
doki action suction 20     # Trigger suction at 20% (TF-PTPRO: one-shot, not continuous)
doki action pause          # Stop all device actions immediately

Timeline Format

Timeline files are JSON files that define device actions at specific timestamps:

{
  "duration": 180.5,
  "actions": [
    {"timestamp": 0.0, "type": "VIBRATION", "value": 50},
    {"timestamp": 5.5, "type": "LINEAR", "value": 30},
    {"timestamp": 10.0, "type": "ROTARY", "value": -50},
    {"timestamp": 15.0, "type": "LINEAR", "value": 80},
    {"timestamp": 20.0, "type": "VIBRATION", "value": 0}
  ]
}

Action Types

| Type | Value Range | Description | |------|-------------|-------------| | LINEAR | 0-100 | Linear/stroke movement intensity | | ROTARY | -100 to 100 | Rotation speed (negative = reverse) | | VIBRATION | 0-100 | Vibration intensity |

Playback Behavior

  • Audio ends → Device automatically stops (all values set to 0)
  • Timeline ends → Device automatically stops
  • Pause → Device stops immediately, timeline position preserved
  • Resume → Audio seeks to timeline position, playback continues
  • Action pause → Device stops immediately, playback continues

Requirements

  • Node.js 18+
  • For audio playback: ffplay (Linux/Windows) or afplay (macOS)

Development

npm install         # Install dependencies
npm start           # Run CLI (uses dist/ artefacts)

# Rebuild after editing source
npm run build:dev   # Dev build: no minify/obfuscation, inline sourcemap, ~sub-second
npm run build       # Release build: minify + obfuscate
npm run restart     # stop + build:dev + start — use this after editing daemon-side code

Using the doki command locally

Without a global install, doki xxx yields command not found. Two options:

# Option A: call the binary directly
node bin/doki.js <command>

# Option B: npm link once — exposes `doki` globally, pointing at this repo
npm link
which doki          # should point at this repo's bin/doki.js
doki <command>

# Remove the symlink when you're done
npm unlink -g @tryjoy/dokidoki

The symlink from npm link just points at bin/doki.js, so subsequent rebuilds don't need a re-link.

Note: the daemon (started by doki start / doki connect) is a separate process running whatever dist/doki.js contained when it launched. Later rebuilds don't affect an already-running daemon.

After editing daemon-side code (daemon.js, bleController.js, profiles.js, etc.) just run:

npm run restart

Edits limited to CLI parsing (cli/index.js, commands like doki profiles) don't require a daemon restart — npm run build:dev is enough.

Logs

Daemon logs are written to /tmp/dokidoki.log

# View logs
tail -f /tmp/dokidoki.log

Languages / 语言 / 言語

License

MIT