Rename lookupDomain() to lookup() (with backwards compatibility)

This commit is contained in:
2025-10-20 15:05:59 -04:00
parent 5cbefe6a14
commit b3adbf8307
6 changed files with 79 additions and 58 deletions
+3 -3
View File
@@ -6,14 +6,14 @@
// echo "example.com" | npx rdapper
import { createInterface } from "node:readline";
import { lookupDomain } from "../dist/index.js";
import { lookup } from "../dist/index.js";
async function main() {
if (process.argv.length > 2) {
// URL(s) specified in the command arguments
console.log(
JSON.stringify(
await lookupDomain(process.argv[process.argv.length - 1]),
await lookup(process.argv[process.argv.length - 1]),
null,
2,
),
@@ -24,7 +24,7 @@ async function main() {
input: process.stdin,
});
rlInterface.on("line", async (line) => {
console.log(JSON.stringify(await lookupDomain(line), null, 2));
console.log(JSON.stringify(await lookup(line), null, 2));
});
}
}