# @types/ip6addr

> TypeScript definitions for ip6addr

Latest version **0.2.6** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/ip6addr
pnpm add @types/ip6addr
yarn add @types/ip6addr
bun add @types/ip6addr
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.2.6 |
| Published | 2023-11-07 |
| First published | 2020-05-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51449 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/ip6addr
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/ip6addr
- npm.io page: https://npm.io/package/@types/ip6addr

## Recent versions

- 0.2.6 (latest) — 2023-11-07
- 0.2.3 (ts3.6) — 2021-07-08
- 0.2.2 (ts3.5) — 2021-03-29
- 0.2.1 (ts3.0) — 2020-08-14
- 0.2.5 — 2023-10-18
- 0.2.4 — 2023-09-26
- 0.2.0 — 2020-05-19

## README

# Installation
> `npm install --save @types/ip6addr`

# Summary
This package contains type definitions for ip6addr (https://github.com/joyent/node-ip6addr).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/ip6addr.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/ip6addr/index.d.ts)
````ts
export interface ToStringOpts {
    format?: "auto" | "v4" | "v4-mapped" | "v6" | undefined;
    zeroElide?: boolean | undefined;
    zeroPad?: boolean | undefined;
}

export interface Addr {
    kind: () => "ipv4" | "ipv6";
    toString: (opts?: ToStringOpts) => string;
    toBuffer: (buff?: Uint8Array) => Uint8Array;
    toLong: () => number;
    offset: (num: number) => Addr | null;
    compare: (other: string | Addr) => number;
    clone: () => Addr;
    and: (input: string | Addr) => Addr;
    or: (input: string | Addr) => Addr;
    not: () => Addr;
}

export interface AddrRange {
    contains: (input: string | Addr) => boolean;
    first: () => Addr;
    last: () => Addr;
}

export interface CIDR extends AddrRange {
    broadcast: () => Addr;
    compare: (other: string | CIDR) => number;
    prefixLength: (format?: "auto" | "v4" | "v6") => number;
    address: () => Addr;
    toString: (opts?: ToStringOpts) => string;
}

export function compare(addr1: string | Addr, addr2: string | Addr): number;

export function compareCIDR(cidr1: string | CIDR, cidr2: string | CIDR): number;

export function createAddrRange(begin: string | Addr, end: string | Addr): AddrRange;

export function createCIDR(addr: string | Addr, len?: number): CIDR;

export function parse(input: string | number | Addr): Addr;

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 03:09:37 GMT
 * Dependencies: none

# Credits
These definitions were written by [Vít Stanislav](https://github.com/slaweet).

---
_Source: https://npm.io/package/@types/ip6addr · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
