Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/apteryxxyz/jswhat

🦁 Identify anything. JSWhat - based on PyWhat - lets you easily identify emails, IP addresses, and more. Works in Node, the browser and the command line. Install: 'npm install jswhat'
https://github.com/apteryxxyz/jswhat

browser cli deno identify javascript jswhat node nodejs npm pywhat regex what

Last synced: about 2 months ago
JSON representation

🦁 Identify anything. JSWhat - based on PyWhat - lets you easily identify emails, IP addresses, and more. Works in Node, the browser and the command line. Install: 'npm install jswhat'

Awesome Lists containing this project

README

        


jsWhat

The easiest way to identify anything

npm install jswhat


jswhat version
total downloads


javascript percentage
jswhat code size
license


github commit activity
code style prettier


apteryxxyz followers
jswhat repo stars

# 🤔 What is `what`?

`JSWhat` is a JavaScript version of the existing [pyWhat](https://github.com/bee-san/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.

`what`s' job is to help you by identifing what something is.

You can view some examples [here](https://github.com/apteryxxyz/jswhat/tree/main/examples).

# 🏓 Table Of Contents

- [🤔 What is `what`?](#-what-is-what)
- [🏓 Table Of Contents](#-table-of-contents)
- [📩 Installation](#-installation)
- [Command Line](#command-line)
- [Node](#node)
- [Browser](#browser)
- [🍕 API](#-api)
- [💻 Command Line](#-command-line)
- [Usage](#usage)
- [Options](#options)
- [Inputs](#inputs)
- [🟢 Node](#-node)
- [Usage](#usage-1)
- [Output](#output)
- [📺 Browser](#-browser)

# 📩 Installation

### Command Line

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

### Node

```bash
npm install jswhat
yarn add jswhat
pnpm add jswhat
```

### Browser

```html

```

# 🍕 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 [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 ` 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

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

`.is( [, options]);`

- ` {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:

```js
{
"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.

```html

```

View the [Node section](#-node) for usage and options.