1.0.1 • Published 1 year ago

@gglvxd/googlesearcher v1.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

GoogleSearcher

Simple google searcher without needing to pay for high cost api

Setup

1.install the package

npm install @gglvxd/googlesearcher
  1. code
const { googlesearch } = require('@gglvxd/googlesearcher');

(async () => {
    try {
        console.log("Searching...");
        const results = await googlesearch('Hello world', 20, 2); // query, limit, page

        if (results.length === 0) {
            console.warn("no results found");
        } else {
            console.log("Results:");
            results.forEach((result, index) => {
                console.log(`Result ${index + 1}:`);
                console.log(`Title: ${result.title}`);
                console.log(`Link: ${result.link}`);
                console.log(`Description: ${result.description}`);
                console.log('---');
            });
        }
    } catch (error) {
        console.error(`Error: ${error.message}`);
    }
})();
1.0.1

1 year ago

1.0.0

1 year ago