📚 Wiki-Search
A simple Node.js library to search and retrieve the main text from Wikipedia articles.
Installation
You can install this library using npm or yarn:
npm install wiki-search-fast
Usage
const Search = require('wiki-search-fast');
Search({ lang: "pt", query: "gato" })
.then(result => {
console.log(result);
})
.catch(error => {
console.error(error.message);
});
Parameters
-
lang
(optional, default: "pt"): Language code for the Wikipedia site (e.g., "en" for English, "es" for Spanish, "fr" for French). -
query
: The term you want to search on Wikipedia.
Example:
const Search = require('wiki-search-fast');
Search({ lang: "en", query: "cat" })
.then(result => {
console.log(result);
})
.catch(error => {
console.error(error.message);
});
License
This project is licensed under the MIT License - see the LICENSE.md file for details.
Acknowledgments
This library is built using axios and cheerio.