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

marama

v1.2.2

Published

A simple calendar component

Readme

Marama

From te reo maori: marama - 1. moon, 2. month

Uasge

var Marama = require('marama')
require('marama/lib/styles-inject')()

const marama = Marama({
  events: [
    { date: new Date(2018, 3, 4), data: { attending: false } },
    { date: new Date(2018, 7, 21), data: { attending: true } }
    // NOTE Date has signatute (Year, monthIndex, day)
  ],
  range: {
    gte: new Date(2018, 7, 13),
    lt: new Date(2018, 7, 20) // range of highlighted dates
  },
  styles: {
    tileRadius: 18,
    tileGap: 4
  }
})

document.body.appendChild(marama)

API

Marama can take the following opts (all optional):

{
  events      // an Array of form: [Event, Event, ... ]  (default: [])
  monthIndex, // month by index e.g. 3 = April                      (default: current month)
  year,       // year we're in                                      (default: current year)
  today       // a Date which can be used to over-ride the definition of today
  range,      // a range to highlight, expects Object of form { gte: Date, lt: Date } (default: null}
  onSelect,   // a callback function _see below_
  styles,     // Object, _see below_
}

An Event is an object with form { date: Date, data: { attending: Boolean, ... } }

Note that if today is set, the "current month" and "current year" defaults will be based on this.

onSelect

A function that is called with data of the form : { gte: Date, lt: Date, events: Array }, where:

  • events is an Array of all events in the range between gte and lt
  • gte and lte are the lower and upper bounds of a range defined by what you clicked on

Note the window of time for a left-click is 1 day wide, but marama also listens for a shift-click. A shift-click takes any currently defined range and stretches it out to the point you've shift-clicked. By managing state outside of marama, it's possible to make some nice interactive featureswith this.

styles

The styles option can be used to change how Marama looks programmatically

{
  tileRadius, // (optional) Number, half-width of a day-tile, in px (default 6)
  tileGap,    // (optional) Number, gap between day-tiles, in px (default: 1)
  dotRadius,  // (optional) Number, radius of the 'attendance' dot in px (default: tileRadius/2)
  dotBorder,  // (optional) Number, depth of outline on an event not attending (default: 1) 
  weekFormat, // (optional) String(rows|columns), which direction weeks run in (default: rows)
}