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

quattro-stagioni

v0.1.0

Published

A library that adds CSS classes for date-related events, currently the current season. Think 'modernizr for dates'.

Readme

quattro-stagioni

quattro-stagioni is a JavaScript library (pure vanilla ES6) that returns the current season for a given date. It can also add the current season as CSS class to an HTML DOM element, e.g. to the body. Think modernizr for seasons.

Usage

npm install --save quattro-stagioni

And in you code:

import { QuattroStagioni } from './index.js';

let qs = new QuattroStagioni()
qs.update() // will add a class 'winter', 'spring', 'summer' or 'autumn' to the <body> tag

See src/example.html for a full example.

Options

There are a few options available in this library.

Change the hemisphere

import { Location, QuattroStagioni } from './index.js';

let locN = Location.NORTHERN_HEMISPHERE
let locS = Location.SOUTHERN_HEMISPHERE

let qsN = new QuattroStagioni(locN)
let qsS = new QuattroStagioni(locS)

console.log(qsN.meteorologicalSeason(), qsS.meteorologicalSeason())

Specific Date

import { QuattroStagioni } from './index.js';

let today = new Date() // change to any date you wish

let qs = new QuattroStagioni()
console.log(qs.meteorologicalSeason(today))
console.log(qs.update(today))

Data Basis

This library works based on the dates reported on the Season page of Wikipedia, the free encyclopedia.

Currently this library only supports meteorological seasons.

The Meaning of Quattro Stagioni

It's Italian and means Four Seasons. Also, it's the name of a delicious type of pizza.

Development

To work on the example.html, run the simple development server:

grunt connect

Then connect to http://localhost:8000/example.html.

Contributions

Contributions are welcome. Please open a PR where you describe your contribution.

Make sure that jshint does not report any errors.

All contributions have to be made available under the same terms as this project, i.e. under the terms of the Creative Commons Zero license.

License

CC0

This code is in public domain.

To the extent possible under law, the authors have waived all copyright and related or neighboring rights to quattro-stagioni.