open-index/open-npm huggingface dataset:
npm package: @kirick/ip
Description: IP address library
Author: Daniil Kirichenko
Latest version: 0.1.6

# @kirick/ip

A TypeScript library for handling IPv4 and IPv6 addresses with convenient conversion methods and subnet operations.

## Features

- 🔄 Unified handling of both IPv4 and IPv6 addresses
- 📥 Support for multiple input formats:
  - String representations
  - ArrayBuffer
  - Node.js Buffer
- 📤 Support for multiple output formats:
  - String representations (standard notation)
  - Byte arrays
  - ArrayBuffer
  - Node.js Buffer
- ✨ IPv4/IPv6 detection
- ⚖️ Address equality comparison
- 🌐 Subnet membership checking

## Installation

```bash
bun add @kirick/ip
# or
pnpm install @kirick/ip
# or
npm install @kirick/ip
```

## Usage

### Basic Usage

```typescript
import { IP } from '@kirick/ip';

// Create IP from string
const ip1 = new IP('127.0.0.1');
const ip2 = new IP('fe80:dead:be:ef::1');

// Check IP version
console.log(ip1.is4()); // true
console.log(ip2.is4()); // false

// Convert to string
console.log(ip1.toString()); // "127.0.0.1"
console.log(ip2.toString()); // "fe80:dead:be:ef::1"
```

### Different Input Formats

```typescript
// From string
const ip1 = new IP('127.0.0.1');

// From ArrayBuffer
const arrayBuffer = new Uint8Array([127, 0, 0, 1]).buffer;
const ip2 = new IP(arrayBuffer);

// From Node.js Buffer
const buffer = Buffer.from([127, 0, 0, 1]);
const ip3 = new IP(buffer);
```

### Different Output Formats

```typescript
const ip = new IP('127.0.0.1');

// To string
console.log(ip.toString()); // "127.0.0.1"

// To byte array
console.log(ip.toByteArray()); // [127, 0, 0, 1]

// To ArrayBuffer
const arrayBuffer = ip.toArrayBuffer();

// To Node.js Buffer
const buffer = ip.toBuffer();
```

### Comparing IP Addresses

```typescript
const ip1 = new IP('127.0.0.1');
const ip2 = new IP('::ffff:127.0.0.1'); // IPv4-mapped IPv6 address

console.log(ip1.equals(ip2)); // true
```

### Subnet Operations

```typescript
const subnet = new IP('127.0.0.0/8');
const ip = new IP('127.0.0.1');

console.log(subnet.includes(ip)); // true
```

## API Reference

### `class IP`

#### Constructor
- `constructor(value: string | ArrayBuffer | Buffer)`

#### Methods
- `is4(): boolean` - Checks if the address is IPv4
- `equals(ip: IP): boolean` - Checks if two IP addresses are equal
- `includes(ip: IP): boolean` - Checks if an IP address is in a subnet
- `toString(): string` - Converts to string representation
- `toByteArray(): number[]` - Converts to byte array
- `toArrayBuffer(): ArrayBuffer` - Converts to ArrayBuffer
- `toBuffer(): Buffer` - Converts to Node.js Buffer

## License

MIT
npm package: @kirick/man
Description: $man is jQuery-like library but with no shit.
Author: Daniil Kirichenko
Latest version: 2.0.0-beta.7

# $man
$man is jQuery-like library, but without any shit.

# Why?
I want to eliminate jQuery from my projects, but I still need to perform simple DOM queries and bind event handlers in a simple way. Writing `document.querySelectorAll` every time and iterate collections to make packet changes/binds is painful, so I grab some ideas and code from http://youmightnotneedjquery.com and wrote that light & simple library.

# How it works?
$man is doing (probably) bad thing: it is extending `NodeList` and `Element` prototypes with jQuery-like functions. 

Unlike jQuery, the main function (`$man('div.class')`) is just an alias to `document.querySelectorAll` and returning `NodeList` instance, so $man is making queries as fast as it can. Oh yes, almost all of $man functions are just lightweight wrappers over the native DOM functions.

Almost all of $man functions are sharing the same names and logic with jQuery functions, e.g. `jQuery('article').find('div.element')` can be written as `$man('article').$find('div.element')` with $man.

**Important**: $man was created to make only DOM traversal and event binding, so it does not contain AJAX (use `fetch` or `axios`), animations (use CSS trantisions instead) or functions like `$.extend`, `$.type` and `$.proxy`.

You can read $man's documentation [here](https://github.com/kirick13/man/wiki/manpage-of-$man).

# Can I just replace jQuery with $man?
The answer is **no**. $man is not fully compatible with jQuery and does not follow jQuery specifications strictly. You **can't** make find-and-replace operations in your jQuery code to migrate to $man. For example, some functions like `filter` and `nextUntil` do not accept function as an argument; $man does not support Sizzle selectors like `:visible`; functions like `each` will be never included to $man because you can iterate collections with `for..of` or `Array.prototype.forEach`.

Unlike jQuery, $man is standing away from adding a custom functionality or supporting old browsers with hacks: it's just making vanilla functions and methods ease to use. If you need to support IE8, you should make it yourself.