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

moecounter.js

v1.0.4

Published

The most effective and efficient MoeCounters for your projects, designed to display a wide range of statistics for your website and more!

Downloads

50

Readme

MoeCounter.js is a JavaScript library that allows for easy integration of attractive visual counters into your web projects or profiles, such as GitHub. With a variety of appearances and customization options, you can add a unique style to your website or application. MoeCounter is perfectly suited for use as a view counter, visit counter, online user counter, subscriber counter, follower counter, etc. It can be seamlessly used on any website or in applications that utilize WebView2.

📦 Installation

npm

npm install moecounter.js

Browser

<script src="https://cdn.jsdelivr.net/npm/moecounter.js@1/dist/browser/moecounter.min.js"></script>

🌍 Demo

https://sefinek.net/npm/moecounter.js/demo

😸 Counters

asoul


https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=asoul&pixelated=true

gelbooru


https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=gelbooru&pixelated=true

moebooru


https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=moebooru&pixelated=true

rule34


https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=rule34&pixelated=true

📃 Documentation

moecounter.local(options)

Generates a visual counter based on the provided options. Using the local function, developers have the ability to specify the exact value they want to display on the counter. In such cases, using your own database is recommended. It's important to note that this function has more lenient query limit restrictions (rate limits). For the purposes of displaying any kind of statistics, the BELOW method is preferred.

options

  • number - (default 0): The value you want to display on the counter.
  • length - (default 10): The length of the counter.
  • theme - (default rule34): The appearance of the counter.
  • pixelated - (default true; recommended true): Should the counter be pixelated?
  • svg - (default false; recommended false): Should the module provide SVG data?

moecounter.remote(options)

In this setup, the API server manages the counter. Developers do not have the capability to modify the counter value. When a user visits a webpage containing the counter (with a link to api.sefinek.net), the counter value will be incremented by 1. An increment is allowed once every 20 minutes from the same IP address. If this limit is exceeded, the server will NOT return any HTTP error, but simply will not increase the counter value.

options

  • name - (required): A unique counter name. It is best to choose a unique name that reflects the purpose of the counter. It's also a good idea to add random characters at the end, e.g., mywebsiteviews-sM7JJb2trEr9.
  • length - (default 10): The length of the counter.
  • theme - (default rule34): The appearance of the counter.
  • pixelated - (default true; recommended true): Should the counter be pixelated?
  • svg - (default false; recommended false): Should the module provide SVG data?

[!IMPORTANT]
Remember to inform users that their IP addresses are collected on an external server (api.sefinek.net)! If you use the counter exclusively on GitHub (in repositories, etc.), you do not need to do this.

🤔 Example

const moecounter = require('moecounter.js');

const showMoeCounter = async () => {
	const data = await moecounter.local({
		number: 1234567890,
		length: 10,
		theme: 'rule34',
		pixelated: true,
		svg: false
	});

	console.log(data);
	// Output:
	// {
	// 	url: 'https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=rule34&pixelated=true&svg=false'
	// }
}

showMoeCounter();

[!NOTE]
If you want to see a sample counter in action, visit this page: https://sefinek.net/genshin-impact-reshade

🍴 Fork

This project is an enhanced fork of journey-ad/Moe-Counter. It features improved rate limit handling and enhanced server-side code quality.

💙 Thank you

If you like this module, please star ⭐ the repository.

If you have any questions or need help, feel free to reach out to me via email or open a new Issue.

🔑 License

This module is provided under the MIT License. See the LICENSE file for more details.

Copyright 2024 © by Sefinek. All Rights Reserved.