Skip to content

Commit c7124b2

Browse files
committed
create README
1 parent 2915771 commit c7124b2

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# @cldn/ip
2+
3+
IP address utility.
4+
5+
## Features
6+
7+
- Works in the browser and in Node.js without any polyfills. (A bundler like Webpack or Vite is recommended for the
8+
browser)
9+
- IPv4 and IPv6 classes.
10+
- Get IP address as BigInt, binary or string.
11+
- Extract IPv4-mapped IPv6 addresses.
12+
- Subnet class with methods to check IP membership, create netmask, list addresses, etc.
13+
- Network class for working with multiple subnets.
14+
- Written in TypeScript.
15+
16+
See the [**Documentation**](https://ip.cldn.pro)
17+
18+
## Installation
19+
20+
```sh
21+
npm install @cldn/ip
22+
```
23+
24+
## Usage
25+
26+
```ts
27+
import {IPv4, IPv6, Subnet} from "@cldn/ip";
28+
29+
const ipv6 = IPv4.fromString("::ffff:192.168.1.42");
30+
const ipv4 = ipv6.getMappedIPv4();
31+
32+
const subnet = Subnet.fromString("192.168.0.0/16");
33+
subnet.has(ipv4); // true
34+
```
35+
36+
## Licence
37+
38+
Copyright © 2024 Cloudnode OÜ
39+
40+
This file is part of @cldn/ip.
41+
42+
@cldn/ip is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
43+
Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
44+
later version.
45+
46+
@cldn/ip is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
47+
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
48+
details.

0 commit comments

Comments
 (0)