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

javascript-calendar

v1.0.1

Published

A really simple event-driven calendar in pure javascript. No dependencies.

Readme

Javascript Calendar

A simple lightweight (<3KB) pure javascript to generate calendars.

You can pass events using optional parameters.

File Size is less than 3 KB - This is a pure javascript calendar, no jQuery or other dependencies required.

Usage

Use directly

If you are using the files from this repository, add the bundled script to the head of your page:

<script type="text/javascript" src="dist/calendar.min.js"></script>

Include the stylesheet too, unless you are creating your own styles:

<link rel="stylesheet" type="text/css" href="dist/calendar.css">

Use with npm

Install the package from npm:

npm install javascript-calendar

For a browser page, load the bundled files from node_modules:

<script type="text/javascript" src="node_modules/javascript-calendar/dist/calendar.min.js"></script>

Include the stylesheet too, unless you are creating your own styles:

<link rel="stylesheet" type="text/css" href="node_modules/javascript-calendar/dist/calendar.css">

In a CommonJS application, require the calendar function directly:

// ES Modules
import Calendar from 'javascript-calendar';

// CommonJS
const Calendar = require('javascript-calendar');

It's really simple to implement a calendar by adding the HTML element to your page:

    <div id="calendar"></div>

Then define your calendar:

    Calendar(document.getElementById('calendar'))

By default, the calendar will use the current date as the calendar date, but you can specify a different date passing it through when you initialize.

    Calendar(document.getElementById('calendar'), {date:new Date()})

You can add the optional parameters by passing a JavaScript object. For example, by default, the calendar uses the browsers local time for Month and Day names. You can override this by passing in your own:

    Calendar(document.getElementById('calendar'), {date:new Date(), days:['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']})

Parameter options:

  • 'date' - The date of the calendar to be instantiated.
  • 'class_prefix' - The class prefix to be used for the calendar. Default is 'javascript-calendar'.
  • 'months' - Override the Month names i.e January, February, March, April, May, June, July, August, September, October, November, December.
  • 'days' - Override the day names i.e Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday.
  • 'events' - The formatted array of events.

The passed event array must be in the following format:

var events = [
    {start: '2025/04/01', end: '2025/04/07', summary: "Example Event", mask: true},
    {start: '2025/04/14', end: '2025/04/20', summary: "Example Event #2", mask: true},
    {start: '2025/05/05', end: '2025/05/15', summary: "Example Event #3", mask: true}
];

Each event must have a start date, end date, summary string and a mask boolean. The mask boolean should be true if you want to 'mask'(block off) event dates, or false.

Please make sure you include the calendar.css style sheet in the head of your page, unless you choose to use your own style declarations.

Requirements

None

License

Copyright (c) Benjamin Hall, [email protected] https://conobe.co.uk

Licensed under the MIT license

Donate?

If you find this project helpful or useful in anyway, please consider getting me a cup of coffee - It's really appreciated :)

Donate