@roniemartinez/iptocc 1.0.0-alpha.1 → 1.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -20
- package/package.json +1 -1
- package/pkg-bundler/README.md +19 -20
- package/pkg-bundler/iptocc_wasm_bg.js +4 -4
- package/pkg-bundler/iptocc_wasm_bg.wasm +0 -0
- package/pkg-bundler/package.json +1 -1
- package/pkg-deno/README.md +19 -20
- package/pkg-deno/iptocc_wasm.js +4 -4
- package/pkg-deno/iptocc_wasm_bg.wasm +0 -0
- package/pkg-no-modules/README.md +19 -20
- package/pkg-no-modules/iptocc_wasm.js +4 -4
- package/pkg-no-modules/iptocc_wasm_bg.wasm +0 -0
- package/pkg-no-modules/package.json +1 -1
- package/pkg-nodejs/README.md +19 -20
- package/pkg-nodejs/iptocc_wasm.js +4 -4
- package/pkg-nodejs/iptocc_wasm_bg.wasm +0 -0
- package/pkg-nodejs/package.json +2 -4
- package/pkg-web/README.md +19 -20
- package/pkg-web/iptocc_wasm.js +4 -4
- package/pkg-web/iptocc_wasm_bg.wasm +0 -0
- package/pkg-web/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
|
-
# iptocc
|
|
1
|
+
# @roniemartinez/iptocc
|
|
2
2
|
|
|
3
|
-
Fast, offline
|
|
3
|
+
Fast, offline IPv4/IPv6 to ISO 3166-1 alpha-2 country code lookup for JavaScript.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- Offline lookup, no API keys, no network calls
|
|
8
|
+
- IPv4 and IPv6 in one call
|
|
9
|
+
- Single string OR batch (array of strings)
|
|
10
|
+
- Multi-target output: Node, bundlers, browser, Deno, no-modules
|
|
11
|
+
- `iptocc` CLI installed alongside the library
|
|
12
|
+
- Database refreshed nightly from the five Regional Internet Registries
|
|
4
13
|
|
|
5
14
|
## Install
|
|
6
15
|
|
|
@@ -10,31 +19,21 @@ npm install @roniemartinez/iptocc
|
|
|
10
19
|
|
|
11
20
|
## Usage
|
|
12
21
|
|
|
13
|
-
### Node (CommonJS)
|
|
14
|
-
|
|
15
22
|
```javascript
|
|
16
23
|
const { country_code } = require("@roniemartinez/iptocc");
|
|
17
24
|
|
|
18
|
-
country_code("8.8.8.8");
|
|
19
|
-
country_code("
|
|
20
|
-
country_code("10.0.0.0"); // undefined
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
### Bundlers, browser, Deno
|
|
24
|
-
|
|
25
|
-
```javascript
|
|
26
|
-
import { country_code } from "@roniemartinez/iptocc";
|
|
27
|
-
|
|
28
|
-
country_code("8.8.8.8"); // "US"
|
|
25
|
+
country_code("8.8.8.8"); // "US"
|
|
26
|
+
country_code(["8.8.8.8", "1.0.16.1"]); // ["US", "JP"]
|
|
29
27
|
```
|
|
30
28
|
|
|
31
|
-
|
|
29
|
+
Per-target entry points: `@roniemartinez/iptocc/{nodejs,bundler,web,deno,no-modules}`.
|
|
32
30
|
|
|
33
|
-
|
|
31
|
+
Run the CLI without installing via `npx`:
|
|
34
32
|
|
|
35
33
|
```bash
|
|
36
|
-
iptocc 8.8.8.8
|
|
37
|
-
|
|
34
|
+
$ npx @roniemartinez/iptocc 8.8.8.8 1.0.16.1
|
|
35
|
+
8.8.8.8 US
|
|
36
|
+
1.0.16.1 JP
|
|
38
37
|
```
|
|
39
38
|
|
|
40
|
-
|
|
39
|
+
Or install the package and the `iptocc` bin is on your `PATH`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@roniemartinez/iptocc",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.2",
|
|
4
4
|
"description": "Fast, offline IP-to-country lookup. WASM bindings for the Rust iptocc crate.",
|
|
5
5
|
"main": "pkg-nodejs/iptocc_wasm.js",
|
|
6
6
|
"module": "pkg-bundler/iptocc_wasm.js",
|
package/pkg-bundler/README.md
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
|
-
# iptocc
|
|
1
|
+
# @roniemartinez/iptocc
|
|
2
2
|
|
|
3
|
-
Fast, offline
|
|
3
|
+
Fast, offline IPv4/IPv6 to ISO 3166-1 alpha-2 country code lookup for JavaScript.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- Offline lookup, no API keys, no network calls
|
|
8
|
+
- IPv4 and IPv6 in one call
|
|
9
|
+
- Single string OR batch (array of strings)
|
|
10
|
+
- Multi-target output: Node, bundlers, browser, Deno, no-modules
|
|
11
|
+
- `iptocc` CLI installed alongside the library
|
|
12
|
+
- Database refreshed nightly from the five Regional Internet Registries
|
|
4
13
|
|
|
5
14
|
## Install
|
|
6
15
|
|
|
@@ -10,31 +19,21 @@ npm install @roniemartinez/iptocc
|
|
|
10
19
|
|
|
11
20
|
## Usage
|
|
12
21
|
|
|
13
|
-
### Node (CommonJS)
|
|
14
|
-
|
|
15
22
|
```javascript
|
|
16
23
|
const { country_code } = require("@roniemartinez/iptocc");
|
|
17
24
|
|
|
18
|
-
country_code("8.8.8.8");
|
|
19
|
-
country_code("
|
|
20
|
-
country_code("10.0.0.0"); // undefined
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
### Bundlers, browser, Deno
|
|
24
|
-
|
|
25
|
-
```javascript
|
|
26
|
-
import { country_code } from "@roniemartinez/iptocc";
|
|
27
|
-
|
|
28
|
-
country_code("8.8.8.8"); // "US"
|
|
25
|
+
country_code("8.8.8.8"); // "US"
|
|
26
|
+
country_code(["8.8.8.8", "1.0.16.1"]); // ["US", "JP"]
|
|
29
27
|
```
|
|
30
28
|
|
|
31
|
-
|
|
29
|
+
Per-target entry points: `@roniemartinez/iptocc/{nodejs,bundler,web,deno,no-modules}`.
|
|
32
30
|
|
|
33
|
-
|
|
31
|
+
Run the CLI without installing via `npx`:
|
|
34
32
|
|
|
35
33
|
```bash
|
|
36
|
-
iptocc 8.8.8.8
|
|
37
|
-
|
|
34
|
+
$ npx @roniemartinez/iptocc 8.8.8.8 1.0.16.1
|
|
35
|
+
8.8.8.8 US
|
|
36
|
+
1.0.16.1 JP
|
|
38
37
|
```
|
|
39
38
|
|
|
40
|
-
|
|
39
|
+
Or install the package and the `iptocc` bin is on your `PATH`.
|
|
@@ -14,10 +14,6 @@ export function country_code(input) {
|
|
|
14
14
|
}
|
|
15
15
|
return takeFromExternrefTable0(ret[0]);
|
|
16
16
|
}
|
|
17
|
-
export function __wbg_Error_2e59b1b37a9a34c3(arg0, arg1) {
|
|
18
|
-
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
19
|
-
return ret;
|
|
20
|
-
}
|
|
21
17
|
export function __wbg___wbindgen_string_get_914df97fcfa788f2(arg0, arg1) {
|
|
22
18
|
const obj = arg1;
|
|
23
19
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
@@ -45,6 +41,10 @@ export function __wbg_length_6e821edde497a532(arg0) {
|
|
|
45
41
|
const ret = arg0.length;
|
|
46
42
|
return ret;
|
|
47
43
|
}
|
|
44
|
+
export function __wbg_new_47dfee3855dec446(arg0, arg1) {
|
|
45
|
+
const ret = new TypeError(getStringFromWasm0(arg0, arg1));
|
|
46
|
+
return ret;
|
|
47
|
+
}
|
|
48
48
|
export function __wbg_new_with_length_1c0fb14ea44d1c09(arg0) {
|
|
49
49
|
const ret = new Array(arg0 >>> 0);
|
|
50
50
|
return ret;
|
|
Binary file
|
package/pkg-bundler/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"Ronie Martinez <ronmarti18@gmail.com>"
|
|
6
6
|
],
|
|
7
7
|
"description": "WASM bindings for iptocc, a fast IP-to-country lookup library written in Rust",
|
|
8
|
-
"version": "1.0.0-alpha.
|
|
8
|
+
"version": "1.0.0-alpha.2",
|
|
9
9
|
"license": "MIT OR Apache-2.0",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
package/pkg-deno/README.md
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
|
-
# iptocc
|
|
1
|
+
# @roniemartinez/iptocc
|
|
2
2
|
|
|
3
|
-
Fast, offline
|
|
3
|
+
Fast, offline IPv4/IPv6 to ISO 3166-1 alpha-2 country code lookup for JavaScript.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- Offline lookup, no API keys, no network calls
|
|
8
|
+
- IPv4 and IPv6 in one call
|
|
9
|
+
- Single string OR batch (array of strings)
|
|
10
|
+
- Multi-target output: Node, bundlers, browser, Deno, no-modules
|
|
11
|
+
- `iptocc` CLI installed alongside the library
|
|
12
|
+
- Database refreshed nightly from the five Regional Internet Registries
|
|
4
13
|
|
|
5
14
|
## Install
|
|
6
15
|
|
|
@@ -10,31 +19,21 @@ npm install @roniemartinez/iptocc
|
|
|
10
19
|
|
|
11
20
|
## Usage
|
|
12
21
|
|
|
13
|
-
### Node (CommonJS)
|
|
14
|
-
|
|
15
22
|
```javascript
|
|
16
23
|
const { country_code } = require("@roniemartinez/iptocc");
|
|
17
24
|
|
|
18
|
-
country_code("8.8.8.8");
|
|
19
|
-
country_code("
|
|
20
|
-
country_code("10.0.0.0"); // undefined
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
### Bundlers, browser, Deno
|
|
24
|
-
|
|
25
|
-
```javascript
|
|
26
|
-
import { country_code } from "@roniemartinez/iptocc";
|
|
27
|
-
|
|
28
|
-
country_code("8.8.8.8"); // "US"
|
|
25
|
+
country_code("8.8.8.8"); // "US"
|
|
26
|
+
country_code(["8.8.8.8", "1.0.16.1"]); // ["US", "JP"]
|
|
29
27
|
```
|
|
30
28
|
|
|
31
|
-
|
|
29
|
+
Per-target entry points: `@roniemartinez/iptocc/{nodejs,bundler,web,deno,no-modules}`.
|
|
32
30
|
|
|
33
|
-
|
|
31
|
+
Run the CLI without installing via `npx`:
|
|
34
32
|
|
|
35
33
|
```bash
|
|
36
|
-
iptocc 8.8.8.8
|
|
37
|
-
|
|
34
|
+
$ npx @roniemartinez/iptocc 8.8.8.8 1.0.16.1
|
|
35
|
+
8.8.8.8 US
|
|
36
|
+
1.0.16.1 JP
|
|
38
37
|
```
|
|
39
38
|
|
|
40
|
-
|
|
39
|
+
Or install the package and the `iptocc` bin is on your `PATH`.
|
package/pkg-deno/iptocc_wasm.js
CHANGED
|
@@ -20,10 +20,6 @@ export function country_code(input) {
|
|
|
20
20
|
function __wbg_get_imports() {
|
|
21
21
|
const import0 = {
|
|
22
22
|
__proto__: null,
|
|
23
|
-
__wbg_Error_2e59b1b37a9a34c3: function(arg0, arg1) {
|
|
24
|
-
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
25
|
-
return ret;
|
|
26
|
-
},
|
|
27
23
|
__wbg___wbindgen_string_get_914df97fcfa788f2: function(arg0, arg1) {
|
|
28
24
|
const obj = arg1;
|
|
29
25
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
@@ -51,6 +47,10 @@ function __wbg_get_imports() {
|
|
|
51
47
|
const ret = arg0.length;
|
|
52
48
|
return ret;
|
|
53
49
|
},
|
|
50
|
+
__wbg_new_47dfee3855dec446: function(arg0, arg1) {
|
|
51
|
+
const ret = new TypeError(getStringFromWasm0(arg0, arg1));
|
|
52
|
+
return ret;
|
|
53
|
+
},
|
|
54
54
|
__wbg_new_with_length_1c0fb14ea44d1c09: function(arg0) {
|
|
55
55
|
const ret = new Array(arg0 >>> 0);
|
|
56
56
|
return ret;
|
|
Binary file
|
package/pkg-no-modules/README.md
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
|
-
# iptocc
|
|
1
|
+
# @roniemartinez/iptocc
|
|
2
2
|
|
|
3
|
-
Fast, offline
|
|
3
|
+
Fast, offline IPv4/IPv6 to ISO 3166-1 alpha-2 country code lookup for JavaScript.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- Offline lookup, no API keys, no network calls
|
|
8
|
+
- IPv4 and IPv6 in one call
|
|
9
|
+
- Single string OR batch (array of strings)
|
|
10
|
+
- Multi-target output: Node, bundlers, browser, Deno, no-modules
|
|
11
|
+
- `iptocc` CLI installed alongside the library
|
|
12
|
+
- Database refreshed nightly from the five Regional Internet Registries
|
|
4
13
|
|
|
5
14
|
## Install
|
|
6
15
|
|
|
@@ -10,31 +19,21 @@ npm install @roniemartinez/iptocc
|
|
|
10
19
|
|
|
11
20
|
## Usage
|
|
12
21
|
|
|
13
|
-
### Node (CommonJS)
|
|
14
|
-
|
|
15
22
|
```javascript
|
|
16
23
|
const { country_code } = require("@roniemartinez/iptocc");
|
|
17
24
|
|
|
18
|
-
country_code("8.8.8.8");
|
|
19
|
-
country_code("
|
|
20
|
-
country_code("10.0.0.0"); // undefined
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
### Bundlers, browser, Deno
|
|
24
|
-
|
|
25
|
-
```javascript
|
|
26
|
-
import { country_code } from "@roniemartinez/iptocc";
|
|
27
|
-
|
|
28
|
-
country_code("8.8.8.8"); // "US"
|
|
25
|
+
country_code("8.8.8.8"); // "US"
|
|
26
|
+
country_code(["8.8.8.8", "1.0.16.1"]); // ["US", "JP"]
|
|
29
27
|
```
|
|
30
28
|
|
|
31
|
-
|
|
29
|
+
Per-target entry points: `@roniemartinez/iptocc/{nodejs,bundler,web,deno,no-modules}`.
|
|
32
30
|
|
|
33
|
-
|
|
31
|
+
Run the CLI without installing via `npx`:
|
|
34
32
|
|
|
35
33
|
```bash
|
|
36
|
-
iptocc 8.8.8.8
|
|
37
|
-
|
|
34
|
+
$ npx @roniemartinez/iptocc 8.8.8.8 1.0.16.1
|
|
35
|
+
8.8.8.8 US
|
|
36
|
+
1.0.16.1 JP
|
|
38
37
|
```
|
|
39
38
|
|
|
40
|
-
|
|
39
|
+
Or install the package and the `iptocc` bin is on your `PATH`.
|
|
@@ -25,10 +25,6 @@ let wasm_bindgen = (function(exports) {
|
|
|
25
25
|
function __wbg_get_imports() {
|
|
26
26
|
const import0 = {
|
|
27
27
|
__proto__: null,
|
|
28
|
-
__wbg_Error_2e59b1b37a9a34c3: function(arg0, arg1) {
|
|
29
|
-
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
30
|
-
return ret;
|
|
31
|
-
},
|
|
32
28
|
__wbg___wbindgen_string_get_914df97fcfa788f2: function(arg0, arg1) {
|
|
33
29
|
const obj = arg1;
|
|
34
30
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
@@ -56,6 +52,10 @@ let wasm_bindgen = (function(exports) {
|
|
|
56
52
|
const ret = arg0.length;
|
|
57
53
|
return ret;
|
|
58
54
|
},
|
|
55
|
+
__wbg_new_47dfee3855dec446: function(arg0, arg1) {
|
|
56
|
+
const ret = new TypeError(getStringFromWasm0(arg0, arg1));
|
|
57
|
+
return ret;
|
|
58
|
+
},
|
|
59
59
|
__wbg_new_with_length_1c0fb14ea44d1c09: function(arg0) {
|
|
60
60
|
const ret = new Array(arg0 >>> 0);
|
|
61
61
|
return ret;
|
|
Binary file
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"Ronie Martinez <ronmarti18@gmail.com>"
|
|
5
5
|
],
|
|
6
6
|
"description": "WASM bindings for iptocc, a fast IP-to-country lookup library written in Rust",
|
|
7
|
-
"version": "1.0.0-alpha.
|
|
7
|
+
"version": "1.0.0-alpha.2",
|
|
8
8
|
"license": "MIT OR Apache-2.0",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
package/pkg-nodejs/README.md
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
|
-
# iptocc
|
|
1
|
+
# @roniemartinez/iptocc
|
|
2
2
|
|
|
3
|
-
Fast, offline
|
|
3
|
+
Fast, offline IPv4/IPv6 to ISO 3166-1 alpha-2 country code lookup for JavaScript.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- Offline lookup, no API keys, no network calls
|
|
8
|
+
- IPv4 and IPv6 in one call
|
|
9
|
+
- Single string OR batch (array of strings)
|
|
10
|
+
- Multi-target output: Node, bundlers, browser, Deno, no-modules
|
|
11
|
+
- `iptocc` CLI installed alongside the library
|
|
12
|
+
- Database refreshed nightly from the five Regional Internet Registries
|
|
4
13
|
|
|
5
14
|
## Install
|
|
6
15
|
|
|
@@ -10,31 +19,21 @@ npm install @roniemartinez/iptocc
|
|
|
10
19
|
|
|
11
20
|
## Usage
|
|
12
21
|
|
|
13
|
-
### Node (CommonJS)
|
|
14
|
-
|
|
15
22
|
```javascript
|
|
16
23
|
const { country_code } = require("@roniemartinez/iptocc");
|
|
17
24
|
|
|
18
|
-
country_code("8.8.8.8");
|
|
19
|
-
country_code("
|
|
20
|
-
country_code("10.0.0.0"); // undefined
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
### Bundlers, browser, Deno
|
|
24
|
-
|
|
25
|
-
```javascript
|
|
26
|
-
import { country_code } from "@roniemartinez/iptocc";
|
|
27
|
-
|
|
28
|
-
country_code("8.8.8.8"); // "US"
|
|
25
|
+
country_code("8.8.8.8"); // "US"
|
|
26
|
+
country_code(["8.8.8.8", "1.0.16.1"]); // ["US", "JP"]
|
|
29
27
|
```
|
|
30
28
|
|
|
31
|
-
|
|
29
|
+
Per-target entry points: `@roniemartinez/iptocc/{nodejs,bundler,web,deno,no-modules}`.
|
|
32
30
|
|
|
33
|
-
|
|
31
|
+
Run the CLI without installing via `npx`:
|
|
34
32
|
|
|
35
33
|
```bash
|
|
36
|
-
iptocc 8.8.8.8
|
|
37
|
-
|
|
34
|
+
$ npx @roniemartinez/iptocc 8.8.8.8 1.0.16.1
|
|
35
|
+
8.8.8.8 US
|
|
36
|
+
1.0.16.1 JP
|
|
38
37
|
```
|
|
39
38
|
|
|
40
|
-
|
|
39
|
+
Or install the package and the `iptocc` bin is on your `PATH`.
|
|
@@ -21,10 +21,6 @@ exports.country_code = country_code;
|
|
|
21
21
|
function __wbg_get_imports() {
|
|
22
22
|
const import0 = {
|
|
23
23
|
__proto__: null,
|
|
24
|
-
__wbg_Error_2e59b1b37a9a34c3: function(arg0, arg1) {
|
|
25
|
-
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
26
|
-
return ret;
|
|
27
|
-
},
|
|
28
24
|
__wbg___wbindgen_string_get_914df97fcfa788f2: function(arg0, arg1) {
|
|
29
25
|
const obj = arg1;
|
|
30
26
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
@@ -52,6 +48,10 @@ function __wbg_get_imports() {
|
|
|
52
48
|
const ret = arg0.length;
|
|
53
49
|
return ret;
|
|
54
50
|
},
|
|
51
|
+
__wbg_new_47dfee3855dec446: function(arg0, arg1) {
|
|
52
|
+
const ret = new TypeError(getStringFromWasm0(arg0, arg1));
|
|
53
|
+
return ret;
|
|
54
|
+
},
|
|
55
55
|
__wbg_new_with_length_1c0fb14ea44d1c09: function(arg0) {
|
|
56
56
|
const ret = new Array(arg0 >>> 0);
|
|
57
57
|
return ret;
|
|
Binary file
|
package/pkg-nodejs/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"Ronie Martinez <ronmarti18@gmail.com>"
|
|
5
5
|
],
|
|
6
6
|
"description": "WASM bindings for iptocc, a fast IP-to-country lookup library written in Rust",
|
|
7
|
-
"version": "1.0.0-alpha.
|
|
7
|
+
"version": "1.0.0-alpha.2",
|
|
8
8
|
"license": "MIT OR Apache-2.0",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -13,9 +13,7 @@
|
|
|
13
13
|
"files": [
|
|
14
14
|
"iptocc_wasm_bg.wasm",
|
|
15
15
|
"iptocc_wasm.js",
|
|
16
|
-
"iptocc_wasm.d.ts"
|
|
17
|
-
"LICENSE-APACHE",
|
|
18
|
-
"LICENSE-MIT"
|
|
16
|
+
"iptocc_wasm.d.ts"
|
|
19
17
|
],
|
|
20
18
|
"main": "iptocc_wasm.js",
|
|
21
19
|
"types": "iptocc_wasm.d.ts"
|
package/pkg-web/README.md
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
|
-
# iptocc
|
|
1
|
+
# @roniemartinez/iptocc
|
|
2
2
|
|
|
3
|
-
Fast, offline
|
|
3
|
+
Fast, offline IPv4/IPv6 to ISO 3166-1 alpha-2 country code lookup for JavaScript.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- Offline lookup, no API keys, no network calls
|
|
8
|
+
- IPv4 and IPv6 in one call
|
|
9
|
+
- Single string OR batch (array of strings)
|
|
10
|
+
- Multi-target output: Node, bundlers, browser, Deno, no-modules
|
|
11
|
+
- `iptocc` CLI installed alongside the library
|
|
12
|
+
- Database refreshed nightly from the five Regional Internet Registries
|
|
4
13
|
|
|
5
14
|
## Install
|
|
6
15
|
|
|
@@ -10,31 +19,21 @@ npm install @roniemartinez/iptocc
|
|
|
10
19
|
|
|
11
20
|
## Usage
|
|
12
21
|
|
|
13
|
-
### Node (CommonJS)
|
|
14
|
-
|
|
15
22
|
```javascript
|
|
16
23
|
const { country_code } = require("@roniemartinez/iptocc");
|
|
17
24
|
|
|
18
|
-
country_code("8.8.8.8");
|
|
19
|
-
country_code("
|
|
20
|
-
country_code("10.0.0.0"); // undefined
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
### Bundlers, browser, Deno
|
|
24
|
-
|
|
25
|
-
```javascript
|
|
26
|
-
import { country_code } from "@roniemartinez/iptocc";
|
|
27
|
-
|
|
28
|
-
country_code("8.8.8.8"); // "US"
|
|
25
|
+
country_code("8.8.8.8"); // "US"
|
|
26
|
+
country_code(["8.8.8.8", "1.0.16.1"]); // ["US", "JP"]
|
|
29
27
|
```
|
|
30
28
|
|
|
31
|
-
|
|
29
|
+
Per-target entry points: `@roniemartinez/iptocc/{nodejs,bundler,web,deno,no-modules}`.
|
|
32
30
|
|
|
33
|
-
|
|
31
|
+
Run the CLI without installing via `npx`:
|
|
34
32
|
|
|
35
33
|
```bash
|
|
36
|
-
iptocc 8.8.8.8
|
|
37
|
-
|
|
34
|
+
$ npx @roniemartinez/iptocc 8.8.8.8 1.0.16.1
|
|
35
|
+
8.8.8.8 US
|
|
36
|
+
1.0.16.1 JP
|
|
38
37
|
```
|
|
39
38
|
|
|
40
|
-
|
|
39
|
+
Or install the package and the `iptocc` bin is on your `PATH`.
|
package/pkg-web/iptocc_wasm.js
CHANGED
|
@@ -20,10 +20,6 @@ export function country_code(input) {
|
|
|
20
20
|
function __wbg_get_imports() {
|
|
21
21
|
const import0 = {
|
|
22
22
|
__proto__: null,
|
|
23
|
-
__wbg_Error_2e59b1b37a9a34c3: function(arg0, arg1) {
|
|
24
|
-
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
25
|
-
return ret;
|
|
26
|
-
},
|
|
27
23
|
__wbg___wbindgen_string_get_914df97fcfa788f2: function(arg0, arg1) {
|
|
28
24
|
const obj = arg1;
|
|
29
25
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
@@ -51,6 +47,10 @@ function __wbg_get_imports() {
|
|
|
51
47
|
const ret = arg0.length;
|
|
52
48
|
return ret;
|
|
53
49
|
},
|
|
50
|
+
__wbg_new_47dfee3855dec446: function(arg0, arg1) {
|
|
51
|
+
const ret = new TypeError(getStringFromWasm0(arg0, arg1));
|
|
52
|
+
return ret;
|
|
53
|
+
},
|
|
54
54
|
__wbg_new_with_length_1c0fb14ea44d1c09: function(arg0) {
|
|
55
55
|
const ret = new Array(arg0 >>> 0);
|
|
56
56
|
return ret;
|
|
Binary file
|
package/pkg-web/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"Ronie Martinez <ronmarti18@gmail.com>"
|
|
6
6
|
],
|
|
7
7
|
"description": "WASM bindings for iptocc, a fast IP-to-country lookup library written in Rust",
|
|
8
|
-
"version": "1.0.0-alpha.
|
|
8
|
+
"version": "1.0.0-alpha.2",
|
|
9
9
|
"license": "MIT OR Apache-2.0",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|