fuck-ip 1.0.1 → 1.1.1

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.
Files changed (3) hide show
  1. package/README.md +12 -12
  2. package/bin/ip +22 -1
  3. package/package.json +8 -4
package/README.md CHANGED
@@ -1,26 +1,26 @@
1
- # Fuck the IP / 淦 IP
1
+ # Log IP
2
2
 
3
- ## Why you should use this package / 为什么你要用这个包
3
+ ## Why you should install this package
4
4
 
5
- Because you want to fuck those complex command lines to get IP information.
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
- ## Steps
9
+ Install globally using npm
10
10
 
11
- 1. Install globally using npm
11
+ ```zsh
12
+ npm i log-ip -g
13
+ ```
12
14
 
13
- ```zsh
14
- npm i fuck-ip -g
15
- ```
15
+ ## How to use
16
16
 
17
- 2. Type `ip` in your ternimal
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
- 3. Done! You will get:
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
- curl ipinfo.io
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.1",
4
- "description": "Get your IP information easily, and fuck those convoluted command lines.",
3
+ "version": "1.1.1",
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/fuck-ip.git"
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
  }