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

@evqovs/danmaku

v1.1.1

Published

A lightweight ESM-based danmaku library.

Readme

Danmaku

A lightweight ESM-based danmaku library.

Usage:

  • Step 1:

    const container: HTMLDivElement | null = document.querySelector('#danmaku-container');
    if (!container) {
        throw new Error("Danmaku container doesn't exist.");
    }

    In the first place, you always need to get an element as the danmaku container (most often a <div>) using document.getElementById() or document.querySelector().

  • Step 2:

    const manager = new DanmakuManager(info);

    Create a DanmakuManager object.

    This is the parameter type for this DanmakuManager constructor:

    interface ManagerOptions {
        min_vertical_gap: number;
        min_horizontal_gap: number;
        track_height: number;
        max_launch_count_per_tick: number;
        max_row_count: number;
        alignment: DanmakuAlignment;
        interval: number;
    }
    • min_vertical_gap: It determines the minimum vertical spacing of danmaku rows.

    • min_horizontal_gap: It determines the minimum horizontal spacing of danmakus (e.g. the spacing between the previous danmaku and the subsequent one).

    • track_height: It determines the height of one danmaku row.

    • max_launch_count_per_tick: The maximum number of launching danmakus per tick.

    • max_row_count: It determines the maximum number of danmaku rows.

    • alignment: It determines the position where the content of a danmaku should be placed.

      • top: The content will be placed at the top of the row.

      • center: The content will be placed at the middle of the row.

      • bottom: The content will be placed at the bottom of the row.

    • interval: Interval time for each rendering (e.g. each tick).

  • Step 3:

    manager.mount(container);

    Calling mount() method to mount the danmaku system to the container that we got before.

  • Step 4:

    manager.push(danmakus);

    push() accepts an array whose type is DanmakuOptions[] from which each of elements describe a danmaku's behavior.

    interface DanmakuOptions {
    duration: number;
    style: Partial<CSSStyleDeclaration>;
    loop: boolean;
    direction: DanmakuDirection;
    node: Node[];
    clone_node: boolean;
    }
    • duration: It specifies the duration of the danmaku from one side to the other.

    • style: You can specifies the style of this container which is a wrapper containing all content you gave of this danmaku.

    • loop: After playing done, drop its information or keep it for the next playing.

      • true: Keep it for the next playing.

      • false: Drop it.

    • direction: It specifies the horizontal movement direction of this danmaku.

    • node: All content you want to be wrapped.

    • clone_node: Copy the nodes you provided or not.

  • Step 5:

    manager.start_render();

    It starts rendering danmaku.

  • Something else:

    If you want a promise which will be settled when all danmakus you provided have been done with rendering, call manager.manager.until_all_done() which returns a promise that will be settled when all done with rendering.