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

jswhat

v2.0.1

Published

Identify anything from email addresses and IPs to crypto wallets. Works in Node, the browser and the command line

Downloads

8

Readme

🤔 What is what?

JSWhat is a JavaScript version of the existing pyWhat. Built in TypeScript, this works in Node, the browser and the command line.

Have you ever come across a mysterious 🧙‍♂️ piece of text and wondered what it might be? Perhaps something like rBxwE6ivExFJjRPh5cZtpq1ghTDm6cV5YP or 2001:0db8:85a3:0000:0000:8a2e:0370:7334? Well with what all you have to do is ask via one of the three available methods and it will tell you! Simply feed what one or more pieces of text and it will try to identify them.

whats' job is to help you by identifing what something is.

You can view some examples here.

🏓 Table Of Contents

📩 Installation

Command Line

npm install jswhat --global
yarn global add jswhat
pnpm add jswhat --global

Node

npm install jswhat
yarn add jswhat
pnpm add jswhat

Browser

<script src="https://unpkg.com/[email protected]/dist/index.js"></script>

🍕 API

💻 Command Line

Once installed globally, you will gain access to the what command. You can use what --help to see a basic help menu containing usage, option information and examples.

Usage

what <inputs> [options]

Options

 -h, --help      Show this help message.
 -v, --version   Show the version number.
 -s, --search    Search within each input for more results.
 --rarity        Filter the results by rarity, one or two numbers from 0 and 1, searated by commas.
 --filter        Filter the results by name, short name, category, or tags, separated by commas.
 --exclude       Exclude the results by name, short name, category, or tags, separated by commas.

Inputs

When wanting to identify some basic text, just type what <inputs> and it will try to identify what it is, simple right? You can identify more than one piece of text at once, just separate them with spaces. If your input has spaces, you can use quotes to enclose it.

🟢 Node

The node module is very simple to use, containing only a single method.

Usage

const what = require('jswhat');
// OR
import what from 'jswhat';

<what>.is(<inputs> [, options]);

  • <inputs> {string|string[]} The text to be identified.
  • [options.search] {boolean} Search the inputs globally.
  • [options.rarity] {[number, number]} Filter the results by rarity.
  • [options.filter] {string[]} Names or tags to filter results by.
  • [options.exclude] {string[]} Names or tags to exclude from the results.

Output

The above method returns an array containing objects in the format of:

{
    "matched": string,              // The content that was matched
    "name": string,                 // Name of what was matched
    "shortName": string,            // A shorter name for what was matched
    "category": string,             // Category of the matched content
    "tags": string[],               // Tags for what was matched
    "description": string | null,   // Description of what was matched
    "rarity": number | null,        // A number between 0 and 1 representing the rarity
    "url": string | null,           // URL to potently more information
    "regex": RegExp,                // The RegExp that was used to match this
}

📺 Browser

jsWhat works in the exact same way in the browser as in Node.

<script src="https://unpkg.com/[email protected]/dist/index.js"></script>

View the Node section for usage and options.