fuck-ip 1.0.1 → 1.1.0
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 +12 -12
- package/bin/ip +22 -1
- package/package.json +8 -4
package/README.md
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Log IP
|
|
2
2
|
|
|
3
|
-
## Why you should
|
|
3
|
+
## Why you should install this package
|
|
4
4
|
|
|
5
|
-
Because you want to
|
|
5
|
+
Because you are lazy as fuck and don't want to remember any command lines or set alias for your terminal.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Installation
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Install globally using npm
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
```zsh
|
|
12
|
+
npm i log-ip -g
|
|
13
|
+
```
|
|
12
14
|
|
|
13
|
-
|
|
14
|
-
npm i fuck-ip -g
|
|
15
|
-
```
|
|
15
|
+
## How to use
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
1. Type `ip` in your ternimal (Compatible with both Windows and Unix)
|
|
18
18
|
|
|
19
19
|
```zsh
|
|
20
20
|
ip
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
2. Done! You will get:
|
|
24
24
|
|
|
25
25
|
```json
|
|
26
26
|
{
|
|
@@ -29,7 +29,7 @@ Because you want to fuck those complex command lines to get IP information.
|
|
|
29
29
|
"region": "Guangdong",
|
|
30
30
|
"country": "CN",
|
|
31
31
|
"loc": "22.5455,114.0683",
|
|
32
|
-
"org": "AS4134 CHINANET-BACKBONE",
|
|
33
32
|
"timezone": "Asia/Shanghai",
|
|
33
|
+
"org": "AS4134 CHINANET-BACKBONE",
|
|
34
34
|
}
|
|
35
35
|
```
|
package/bin/ip
CHANGED
|
@@ -1 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const chalk = require("chalk");
|
|
4
|
+
const { exec } = require("child_process");
|
|
5
|
+
|
|
6
|
+
exec("curl ipinfo.io", (err, stdout, stderr) => {
|
|
7
|
+
const { error, log } = console;
|
|
8
|
+
if (err) {
|
|
9
|
+
error(`Error: ${err.message}`);
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const { ip, city, region, country, loc, org, timezone } = JSON.parse(stdout);
|
|
14
|
+
|
|
15
|
+
log(chalk.green("IP: ", ip));
|
|
16
|
+
log(chalk.white("City: ", city));
|
|
17
|
+
log(chalk.yellow("Region: ", region));
|
|
18
|
+
log(chalk.green("Country: ", country));
|
|
19
|
+
log(chalk.white("Location: ", loc));
|
|
20
|
+
log(chalk.yellow("Timezone: ", timezone));
|
|
21
|
+
log(chalk.green("Org: ", org));
|
|
22
|
+
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fuck-ip",
|
|
3
|
-
"version": "1.0
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "Fuck your IP information easily.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"ip": "./bin/ip"
|
|
7
7
|
},
|
|
@@ -16,11 +16,15 @@
|
|
|
16
16
|
"location",
|
|
17
17
|
"tool"
|
|
18
18
|
],
|
|
19
|
-
"type": "module",
|
|
20
19
|
"author": "William Tan youngtam733@gmail.com",
|
|
21
20
|
"license": "MIT",
|
|
21
|
+
"shebang": "#!/usr/bin/env node",
|
|
22
22
|
"repository": {
|
|
23
23
|
"type": "git",
|
|
24
|
-
"url": "https://github.com/ChuYang-FE/
|
|
24
|
+
"url": "https://github.com/ChuYang-FE/log-ip.git"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"chalk": "^4.1.2",
|
|
28
|
+
"child_process": "^1.0.2"
|
|
25
29
|
}
|
|
26
30
|
}
|