urban
urban copied to clipboard
How to get an array of search results
The npm description does not explain too much about how to use this package so Im going to ask here.
If I wanted to get an array of search results for a search term, how would i go about doing that?
Here's how I would do it:
const urban = require("urban")
urban("some_word").res((json) => {
console.log("List response:");
for (const i in json) {
console.log(`Result ${i}:`);
console.log(json[i]);
}
});