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 🙏

© 2024 – Pkg Stats / Ryan Hefner

witch-clock

v1.0.1

Published

get dates relative to solar and lunar events

Downloads

11

Readme

Witch Clock

Build Status

Tool for computing dates around solstices and equinoxes, answering questions like, "How many days until the Summer Solstice?"

witch-clock concerns itself with solstices and equinoxes. For more witchy star shit, check out astronomia.

Install

As a library: npm install witch-clock

As a CLI: npm install -g witch-clock; access via witch-clock

Usage, library

var witch = require('witch-clock')
var date = new Date(...)
var event = witch.solar.soonest(date)
console.log(event)
> { code:"VE-78", date: 2017-03-20T10:28:52.704Z, name: "vernal equinox"}

witch-clock exposes more methods than that but I haven't documented them yet. Kick up node, require('witch-clock') into some throwaway variable, and poke around!

Usage, CLI

$ witch-clock
VE-80, WS+9, FIRST-6, NEW+1

$ witch-clock -v
VE-79 | vernal equinox @ 2017-03-20T10:28:52.704Z
WS+10 | winter solstice @ 2016-12-21T10:44:19.494Z
FIRST-5 | first @ 2017-01-05T19:46:59.933Z
NEW+2 | new @ 2016-12-29T06:53:18.964Z

$ witch-clock -j
{"solar":{"soonest":{"code":"VE-79","name":"vernal equinox","date":"2017-03-20T10:28:52.704Z"},"recent":{"code":"WS+10","name":"winter solstice","date":"2016-12-21T10:44:19.494Z"}},"lunar":{"soonest":{"code":"FIRST-5","name":"first","date":"2017-01-05T19:46:59.933Z"},"recent":{"code":"NEW+2","name":"new","date":"2016-12-29T06:53:18.964Z"}}}

$ witch-clock -j | python -m json.tool
{
    "lunar": {
        "recent": {
            "code": "NEW+2",
            "date": "2016-12-29T06:53:18.964Z",
            "name": "new"
        },
        "soonest": {
            "code": "FIRST-5",
            "date": "2017-01-05T19:46:59.933Z",
            "name": "first"
        }
    },
    "solar": {
        "recent": {
            "code": "WS+10",
            "date": "2016-12-21T10:44:19.494Z",
            "name": "winter solstice"
        },
        "soonest": {
            "code": "VE-79",
            "date": "2017-03-20T10:28:52.704Z",
            "name": "vernal equinox"
        }
    }
}

In the default and verbose results, the order of events goes: [soonest solar], [recent solar], [soonest lunar], [recent lunar].

The -v option prints the shortcode, name, and date of each event. the -j option presents verbose info as JSON.

Or, I mean, you could type witch-clock -h to see what's up.

Usage, interpersonal

witch-clock expresses dates like "VE-80" or "SS+12" but telling your friend "it's vee-ee eighty" can be hard to say and easily misheard. So instead try:

  • VE: "vern", SS: "sum", AE: "auto", WS: "win"
  • "-": "sub", "+": "plus"

So "VE-80" becomes "vern sub eighty". Of course, that won't make sense either to someone who doesn't understand the format. "Oh, I mean, eighty days til the vernal equinox."

N.B.: If an event is "-0" as in "VE-0" or "FIRST-0" then that event is happening today. If an event is "+0" then it happened less than a day ago.

License

GPLv3