true-phone 1.0.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.
Files changed (2) hide show
  1. package/index.js +23 -0
  2. package/package.json +17 -0
package/index.js ADDED
@@ -0,0 +1,23 @@
1
+ const axios = require("axios");
2
+
3
+ const BASE_URL = "https://apitu.psnw.xyz/index.php";
4
+
5
+ async function lookupPhone(phone, mode = "sff") {
6
+ if (!phone) {
7
+ throw new Error("Phone number is required");
8
+ }
9
+
10
+ const res = await axios.get(BASE_URL, {
11
+ params: {
12
+ type: "phone",
13
+ value: phone,
14
+ mode
15
+ }
16
+ });
17
+
18
+ return res.data;
19
+ }
20
+
21
+ module.exports = {
22
+ lookupPhone
23
+ };
package/package.json ADDED
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "true-phone",
3
+ "version": "1.0.0",
4
+ "description": "NPM wrapper for phone lookup API",
5
+ "main": "index.js",
6
+ "keywords": [
7
+ "api",
8
+ "phone",
9
+ "lookup",
10
+ "thai"
11
+ ],
12
+ "author": "Nattapon911",
13
+ "license": "MIT",
14
+ "dependencies": {
15
+ "axios": "^1.13.2"
16
+ }
17
+ }