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

indicatoring

v1.0.3

Published

screen with circular indicator for response waiting.

Downloads

9

Readme

Latest Version Bundle Size GitHub Issues Supported Node

Description

indicatoring module is a spinner for response waiting. simple, easy to use, and can be customized with some of the arguments provided. circular indicators can be added or removed at want locations. also, it has various uses beyond waiting for data responses. provides both package installation and a CDN.

<!-- latest version -->
<script src="https://cdn.jsdelivr.net/npm/indicatoring/dist/index.js"></script>

<!-- X.X.X version -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/index.js"></script>

Preview

Preivew

Cautions

use Indicatoring.open() to begin and Indicatoring.close() to finish. to prevent flickering, the Indicator does not run if Indicatoring.close() is called within 300 milliseconds of Indicatoring.open(). if you use the limit argument, you can omit Indicatoring.close() because it automatically closes when the time expires.

Examples

available in major JavaScript libraries and frameworks

import Indicatoring from 'indicatoring';
// or
const Indicatoring = require('indicatoring');
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <script src="https://cdn.jsdelivr.net/npm/indicatoring/dist/index.js"></script>
  </head>
  <body>
    <div>
      <button onclick="handleRequest()">Click here</button>
    </div>
  </body>
  <script>
    async function handleRequest() {
      Indicatoring.open(); // run while waiting for a response
      fetch('https://api.github.com/users/devcheeze')
        .then((response) => {
          // process response data...
        })
        .catch((error) => {
          // process response error...
        })
        .finally(() => {
          Indicatoring.close(); // required if no limit arguments
        });
    }
  </script>
</html>
import React from 'react';
import Indicatoring from 'indicatoring';

class App extends React.Component {
  handleRequest = async () => {
    Indicatoring.open(); // run while waiting for a response
    fetch('https://api.github.com/repos/devcheeze/indicatoring')
      .then((response) => {
        // process response data...
      })
      .catch((error) => {
        // process response error...
      })
      .finally(() => {
        Indicatoring.close(); // required if no limit
      });
  };

  render() {
    return (
      <div>
        <button onClick={this.handleRequest}>Click here</button>
      </div>
    );
  }
}

export default App;
<template>
  <div>
    <button @click="handleRequest">Click here</button>
  </div>
</template>

<script>
export default {
  methods: {
    async handleRequest() {
      Indicatoring.open(); // run while waiting for a response
      fetch('https://api.github.com/repos/devcheeze/indicatoring')
        .then((response) => {
          // process response data...
        })
        .catch((error) => {
          // process response error...
        })
        .finally(() => {
          Indicatoring.close(); // required if no limit
        });
    },
  },
};
</script>

<style></style>
import { Component } from '@angular/core';
import Indicatoring from 'indicatoring';

@Component({
  selector: 'app-root',
  template: `
    <div>
      <button (click)="handleRequest()">Click here</button>
    </div>
  `,
})
export class AppComponent {
  handleRequest() {
    Indicatoring.open(); // run while waiting for a response
    fetch('https://api.github.com/repos/devcheeze/indicatoring')
      .then((response) => {
        // process response data...
      })
      .catch((error) => {
        // process response error...
      })
      .finally(() => {
        Indicatoring.close(); // required if no limit
      });
  }
}

Arguments

| Argument | Object Name | Key Name | Value Type | Default Value | Required | | -------- | ----------- | -------- | ------------------------------ | -------------------- | -------- | | limit | - | - | Number | 0 | optional | | config | background | color | String | "rgba(0, 0, 0, 0.6)" | optional | | | | blur | Boolean | false | optional | | | message | color | String | "#fff" | optional | | | | size | "large" or "medium" or "small" | "medium" | optional | | | | text | String or NULL | NULL | optional | | | icon | color | String | "#fff" | optional | | | | size | "large" or "medium" or "small" | "medium" | optional |

all arguments are optional and apply arguments as shown below. arguments will be added through updates. the code below is an example of declaring all the arguments provided.

Indicatoring.open(
  6000, // indicating duration of 6 seconds. (in m/s)
  {
    background: {
      color: 'rgba(20, 20, 20, 0.4)', // change background color.
      blur: true, // background blur effect or not.
    },
    message: {
      color: 'red', // text message font color.
      size: 'small', // text message font size.
      text: 'Wait Please..', // text message content.
    },
    icon: {
      size: 'large', // circular icon size.
      color: '#f1f2f3', // circular icon color.
    },
  }
);

ETC