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

spinein

v0.0.2

Published

Spine like a shell spinner

Downloads

1

Readme

Spine in

Spine like a shell spinner \ | / -

Why

Fun.

Usage

With presets frames

spine('dots').in('.spinner-div');
spine('triangle').in('.spinner-div');

Check full list of all available prests

With your own frames

spine({
  interval: 100,
  frames: ['\\', '/']
}).in('.spinner-div');

Share spinner

var spinner = spine('dots');
spinner.in('.first-div');
spinner.in('.second-div');

Stop spinning

var spinner = spine('dots').in('.spinner-div');

setTimeout(function(){
  clearInterval(spinner);
}, 5000);

// will stop spinning after 5 seconds

Real Example

[...]
  <div class="spinner"></div>
  <script src="spine.js"></script>
  <script>
    document.addEventListener('DOMContentLoaded', function(){
      spine('dots').in('.spinner');
    });
  </script>
[...]

Check all examples here

API

spine(spinner).in(element)

String|Object spinner
As string: it will use a preset spinner, you can check all in spine.spinners
As object: it need two properties: frames as array of strings to rotate, and interval as integer of frame interval

// string
spine('dots').in(...)
// object
spine({ frames: ['1', '2'], interval: 100 }).in(...)

String|DOMElement element
As string: it will use document.querySelector to find the DOM Element to use as wrapper of spinner.
As domelement: it will used to wrapper of spinner.

// string
spine(...).in('.wrapper');
// domelement
var wrapper = document.querySelector('.wrapper');
spine(...).in(wrapper);