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

signalk-sun-moon

v1.0.2

Published

Webapp with sun & moon information (rise/set, phase, etc) based on vessel's position.

Readme

signalk-sun-moon

A Signal K server plugin / standalone webapp that shows clean, clear sun and moon information for the vessel's current position and a chosen day: rise/set times, a sun-state graphic, and a moon-state graphic.

  • Two cards — Sun and Moon — each with a large square graphic plus text.
  • Navigate days with ‹ Prev · date-picker · Next › (and a Today shortcut).
  • All data comes from a single plugin HTTP endpoint, documented by an OpenAPI 3.0 doc.
  • Builds for Chromium 69 (Navico / older MFD browsers).

See SPEC.md for the full design.

Note: This plugin does not publish any Signal K paths — its data is served only through the HTTP endpoint above. If you want sun/moon data in your Signal K data tree, install signalk-derived-data.

Install

Install from the Signal K Appstore, or manually into your server's plugin folder:

cd ~/.signalk/node_modules/signalk-sun-moon   # or clone here
npm install
npm run build                                  # emits public/ (the webapp)

Restart the Signal K server. Then:

  • Webapp: http://<server>:3000/signalk-sun-moon/
  • API: http://<server>:3000/plugins/signalk-sun-moon/api
  • OpenAPI: Admin UI → Documentation → OpenAPI → Sun & Moon API

npm run build must be run before packaging/using the webapp — public/ is the build output and is git-ignored.

Configuration

The plugin has no configurable options.

Position resolves in order: lat/lon query params → vessel navigation.position → otherwise 400 no_position. Graphic style is a client-side choice (static premade assets by default; override with ?imageStyle=generated).

API

GET /plugins/signalk-sun-moon/api?date=YYYY-MM-DD&lat=<deg>&lon=<deg>

All params optional. lat/lon must be supplied together. Times are ISO-8601 UTC (or null); the webapp formats them to the browser's local time. The response reports the resolved position.source, the UTC dayWindowUtc, and the evaluatedAt instant used for point-in-time values (see SPEC §4).

curl 'http://localhost:3000/plugins/signalk-sun-moon/api?date=2026-07-03&lat=37.81&lon=-122.42'

Errors are { "error": "<code>", "message": "..." } with codes bad_date, bad_position, no_position, internal.

Development

npm run dev       # Vite dev server (proxies /plugins and /signalk to localhost:3000)
npm run build     # build the webapp into public/
npm run preview   # preview the production build
npm run assets    # resize art/ sun/moon source images into static webp in src/assets/
npm run icons     # regenerate app/favicon/PWA icons from art/sunmoon-logo.png

The static sun/moon art (used by StaticImageProvider) is resized from the high-resolution source images in art/sun/ and art/moon/ by npm run assets into src/assets/. Regenerate it after changing the source art.

Icons (Signal K app icon, favicons, and Android/iOS home-screen icons) are derived from the master logo art/sunmoon-logo.png by npm run icons and committed under src/assets/. Regenerate them after changing the logo. The webapp is installable to the home screen on iOS and Android via src/assets/site.webmanifest and the meta tags in src/index.html.

During vite dev, point a running Signal K server at http://localhost:3000 (or edit the proxy target in vite.config.js).

Architecture

Non-UI logic lives in framework-independent ES classes; React only owns rendering.

  • Server (index.js, server/): ApiRouter, PositionResolver, AstroService (wraps suncalc v2), DateWindow.
  • Client logic (src/): ApiClient, DateController, TimeFormatter, and the graphics ImageProvider family (GeneratedImageProvider / StaticImageProvider, SunGraphicRenderer, MoonRenderer).
  • Client UI (src/ui/): App, Toolbar, SunCard, MoonCard.

License

Apache-2.0