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

@startxapp/starrysky

v1.0.2

Published

Dynamic starry sky animation with meteors and smooth rotation

Readme

Starrysky.js

Dynamic starry sky animation with smooth rotation, twinkling stars and realistic meteor effects. Zero dependencies, lightweight and ready for production.


Installation

npm i @startxapp/starrysky

Or via CDN:

<script src="https://cdn.jsdelivr.net/npm/@startxapp/[email protected]/dist/starrysky.min.js"></script>

Basic Usage

ES Modules

import Starrysky from '@startxapp/starrysky';

Starrysky({
  starDensity: 0.0015,
  enableMeteors: true
});

Browser

<script src="starrysky.min.js"></script>
<script>
  Starrysky();
</script>

Configuration

| Option | Type | Default | Description | | --------------------- | ----------- | ------------- | -------------------------------- | | container | HTMLElement | document.body | Container element for the canvas | | starCount | number | auto | Fixed number of stars | | starDensity | number | 0.001 | Stars per pixel ratio | | starColors | array | see source | RGB color array | | starMinSize | number | 0.2 | Minimum star radius | | starMaxSize | number | 1.7 | Maximum star radius | | starTwinkleSpeed | number | 0.004 | Twinkle animation speed | | rotationSpeed | number | 0.0003 | Sky rotation speed | | enableMeteors | boolean | true | Enable meteor system | | maxMeteorsAtOnce | number | 5 | Max concurrent meteors | | firstMeteorDelay | number | 1000 | Delay before first meteor (ms) | | meteorMinDelay | number | 10000 | Min delay between meteors (ms) | | meteorMaxDelay | number | 25000 | Max delay between meteors (ms) | | meteorBurstChance | number | 0.01 | Meteor burst probability | | meteorBurstDelayMin | number | 20000 | Min burst delay (ms) | | meteorBurstDelayMax | number | 50000 | Max burst delay (ms) | | meteorSpeed | number | 3 | Meteor velocity | | meteorSizeMin | number | 1.2 | Min meteor size | | meteorSizeMax | number | 3.2 | Max meteor size | | meteorTailLength | number | 60 | Trail length | | meteorLifeReduction | number | 0.007 | Life decay per frame | | fadeDuration | number | 0 | Fade-in duration (ms) | | starsFadeDelay | number | 0 | Stars fade delay (ms) | | meteorsFadeDelay | number | 0 | Meteors fade delay (ms) | | fadeEasing | string | smooth | Easing type | | canvasId | string | auto | Canvas ID | | canvasZIndex | number | -2 | Canvas z-index | | autoPauseOnTabChange | boolean | true | Pause on tab inactive | | autoResumeOnTabReturn | boolean | true | Resume on tab active | | preserveTimeOnPause | boolean | true | Keep animation timing | | debug | boolean | false | Enable logs |


API Methods

Control

Starrysky.pause();
Starrysky.resume();
Starrysky.stop();
Starrysky.restart(config);

State

Starrysky.isRunning();
Starrysky.isPaused();
Starrysky.getStats();
Starrysky.getConfig();

Update

Starrysky.updateConfig(newConfig);

Multi-instance

const instance1 = Starrysky.create('sky-1');
instance1.start({ starDensity: 0.001 });

const instance2 = Starrysky.create('sky-2');
instance2.start({
  starDensity: 0.002,
  container: document.getElementById('hero')
});

Events

| Event | Parameters | Description | | ------------- | ----------------- | ---------------------------- | | onStart | instance | Called when animation starts | | onStop | instance | Called when animation stops | | onPause | - | Called when paused | | onResume | - | Called when resumed | | onMeteor | meteor | Meteor created | | onMeteorEnd | meteor | Meteor removed | | onMeteorBurst | meteors | Burst event | | onStarCreated | star, index | Star created | | onResize | { width, height } | Window resized |


Example

const sky = Starrysky({
  container: document.getElementById('hero'),
  starDensity: 0.0012,
  rotationSpeed: 0.00015,
  enableMeteors: true,
  meteorSpeed: 2.5,
  fadeDuration: 2000,
  starsFadeDelay: 500,
  fadeEasing: 'ease-out',
  debug: false,

  onStart: () => console.log('Sky animation started'),
  onMeteor: (meteor) => console.log('Meteor created', meteor)
});

Browser Support

All modern browsers with Canvas support:

  • Chrome 60+
  • Firefox 55+
  • Safari 12+
  • Edge 79+

Development

npm install
npm run build

License

This project is licensed under the MIT License – see the LICENSE file for details.


Author

StarTX [email protected]