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

@vicoders/support

v2.0.13

Published

Vicoders Support

Downloads

11

Readme

Vicoders Supporter Package

Collection of javascript utility functions.

Installation

Using npm

npm install @vicoders/support

Using yarn

yarn add @vicoders/support

Functions & Services

Notification

The notification library

// Partial import
import Notification from '@vicoders/support/services/Notification';
// Or you can do like this
// import { Notification } from '@vicoders/support/services';

Notification.show('success', 'This is a successed message and it will display for 3000 ms', 3000); // show the loader
Notification.show('success', 'This one display forever until you remove it');
Notification.show('warning', 'ALERT!!!'); // and the warning type
Notification.remove(); // hide the notification

Loader

The loading animation

// partial import
import Loader from '@vicoders/support/services/Loader';
// Or you can do like this
// import { Loader } from '@vicoders/support/services';

Loader.show(); // show the loader
Loader.hide(); // hide the loader

Sharing

Share content to social media

// partial import
import { Facebook } from '@vicoders/support/services/Social/Sharing/Facebook/Facebook';
// Or you can do like this
import { Facebook } from '@vicoders/support/services/Social/Sharing';

const fb = new Facebook({ appId: YOUR_FB_APP_ID });
fb.share({ href: 'https://example.com' });

// or share current page

fb.share({ href: document.location.href });

Anchor

Jump to element smooth

// partial import
import { Anchor } from '@vicoders/support/services/Anchor';
// Or you can do like this
import { Anchor } from '@vicoders/support/services';

const anchor = new Anchor();

anchor.jump('#element-id');

// anchor.jump('.element-class');
// anchor.jump('element-tag');

Utils

getRandomArbitrary

Returns a random number between min (inclusive) and max (exclusive)

import { Utils } from '@vicoders/support/services';

const r = Utils.getRandomArbitrary(1, 10);

random

Returns a random integer between min (inclusive) and max (inclusive).

  • The value is no lower than min (or the next integer greater than min
  • if min isn't an integer) and no greater than max (or the next integer
  • lower than max if max isn't an integer).
  • Using Math.round() will give you a non-uniform distribution!
import { Utils } from '@vicoders/support/services';

const r = Utils.random(1, 10);

findRandom

Find a random element of an array

import { Utils } from '@vicoders/support/services';

const r = Utils.findRandom([1, 2, 3, 4, 5, 6, 7], item => item % 2);