urban icon indicating copy to clipboard operation
urban copied to clipboard

How to get an array of search results

Open Ravenwulf opened this issue 4 years ago • 1 comments

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?

Ravenwulf avatar Jun 24 '20 04:06 Ravenwulf

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]);
    }
});

SatvikR avatar Aug 18 '20 18:08 SatvikR