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

llama

v2.2.0

Published

Wooley, sure-footed. A very small kit of reusable UI utilities.

Readme

Llama toolkit

Wooly, sure-footed, a thin layer above vanilla JS for SPA dev (no dependencies).

Provides:

  • a Component API
  • an event-bus
  • a router

API Doc

Table of Contents

llama

Set all the Llama goodness together

Parameters

  • options Object the configuration options

    • options.box string? the id of the div we load components in
    • options.eventBus EventBus? an event-bus to pass to the different Components
    • options.context Object? a shared context object for all the routes
    • options.routes Object<string, (Class<Component> | RouteTarget)> the description of routes
    • options.logger Console? define a logger, can be {logger: console} to send on the javascript console

RouteTarget

Type: Object

Properties

  • type Class<Component>?
  • name string? name of the component to serve as source for event listeners
  • box string? the id of an HTML element the component is rendered into
  • sub_box string? the id of an HTML element the embedded sub-component are rendered into
  • css string? a string of CSS to be injected
  • logger Console? define a logger, can be {logger: console} to send on the javascript console
  • embed Object<string, RouteTarget> embedded route

Component

Common ground for vanilla Widget Component

Parameters

  • options Object a set of option al

    • options.name string? name of the component to serve as source for event listeners
    • options.box string? the id of the HTMLElement to which we want to plug the component
    • options.eventBus EventBus? to receive and send events
    • options.context Object<string, any>?
    • options.logger Console? define a logger, can be {logger: console} to send on the javascript console
    • options.css string?

listen

Listen events

call

Call for loading of the component

Parameters

load

Load component inside the box

Parameters

unload

Unload component

prepareBox

Returns (ShadowRoot | HTMLElement)

populate

Parameters

addChildren

Parameters

removeChildren

Parameters

init

init the component after appending to DOM

Parameters

postLoad

activate after load

Parameters

clean

clean the component after removing from DOM

on

Attach an event listener for this source component

Parameters

emit

Emit an event for a given key that are sent to every attached events listeners

Parameters

  • k string the event key
  • p ...any the optional args

gId

Parameters

Returns HTMLElement

addEvtById

Parameters

hasHTML

Returns boolean

empty

Clear the box contents

Parameters

  • box Node (optional, default this.prepareBox())

fragmentFromHtml

Generate DOM Element from source HTML

Parameters

Returns DocumentFragment the generated DOM Element

injectCSS

Inject component defined CSS into the box (if it exists)

Parameters

  • box Node (optional, default this.prepareBox())

injectHTML

Inject component defined HTML into the box (if it exists)

Parameters

HostComponent

A component that host embedded Component

setSubRoute

Parameters

SimpleEventBus

A simple event bus to enable event-driven architecture

Parameters

  • options Object optional parameters

    • options.name string? define a name, in a multi EventBus scenario
    • options.logger Console? define a logger, can be {logger: console} to send on the javascript console

on

Attach an event listener for a source

Parameters

emit

Emit an event for a given key that are sent to every attached events listeners

Parameters

  • k string the event key
  • p ...any the optional args

clear

Clear event listeners for a source

Parameters

  • s string the name of the source to clear events for
  • filter (optional, default ()=>true)

SequenceEventBus

A Complex event bus to enable event-driven architecture with a before and after event hook

Parameters

  • options Object optional parameters

    • options.logger Console? define a logger, can be {logger: console} to send on the javascript console

on

Attach an event listener for a source

Parameters

emit

Emit an event for a given key that are sent to every attached events listeners

Parameters

  • k string the event key
  • p ...any the optional args

clear

Clear event listeners for a source

Parameters

  • s string the name of the source to clear events for
  • filter (optional, default ()=>true)

Router

A simple router for Llama Component

Parameters

  • eventBus EventBus

  • options object?

    • options.logger Console? define a logger, can be {logger: console} to send on the javascript console

routes

Properties

before

Parameters

on

Parameters

run

Run the router

stop

Stop the router

go

Go to a route matching the given path

Parameters

route

Route the browser