npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

pokemon-api-wrapper

v1.1.0

Published

A simple wrapper for the PokeAPI

Downloads

253

Readme

Pokémon API Wrapper

The Pokémon API Wrapper is a Node.js module for easily accessing data from the official Pokémon API. This update adds features to retrieve detailed information about Pokémon, including the type, abilities, stats, and image of the Pokémon in question. This version also supports the personalization of messages used for questions and answers.

Contents

Présentation

Pokémon API Wrapper is designed to simplify access to Pokémon data through the official Pokémon API. This module uses Axios for HTTP requests and supports retrieving Pokémon types, abilities, stats, and images. It also includes a question-and-answer system based on Pokémon abilities.

Update 1.1.0

This version adds the following features:

  • Retrieval of a Pokémon's types, abilities, hidden abilities, stats and image.
  • Personalization of messages for the question-and-answer system.

Installation

Use npm for installation. Node.JS 20 or newer required.

npm install pokemon-api-wrapper

Usage

/* Create Wrapper instance */
const PokemonAPIWrapper = require('pokemon-api-wrapper');
const wrapper = new PokemonAPIWrapper();

/* Get detailled information about a Pokémon with his name */
const data = await wrapper.getPokemonByName('pikachu');
console.log(data);

/* Get Pokémon type with his name */
const type = await wrapper.getType('pikachu');
console.log('Types :', type);

/* Get Pokémon abilities with his name */
const abilities = await wrapper.getAbilities('pikachu');
console.log('Capacités :', abilities);

/* Get Pokémon hidden abilities with his name */
const hiddenAbilities = await wrapper.getHiddenAbilities('pikachu');
console.log('Capacités cachées :', hiddenAbilities);

/* Get Pokémon statistics with his name */
const stats = await wrapper.getStats('pikachu');
console.log('Statistiques :', stats);

/* Get Pokémon image with his name */
const image = await wrapper.getImage('pikachu');
console.log('Image :', image);

/* Generate question based on Pokémon's name */
const questionData = await wrapper.getQuestion('pikachu');
console.log('Question :', questionData.question);
console.log('Correct answer :', questionData.correctAnswer);

/* Edit messages */
wrapper.setQuestionMessage('question', "What {{pokemon}}' type ?");
wrapper.setQuestionMessage('correctAnswer', 'Correct answer was {{correctAnswer}}.');

Contributing

Contributions are welcome! If you find any bugs or want to add new features, don't hesitate to open an issue or pull request.

License

This README.md offers a complete guide on using the new features and how users can integrate this module into their projects. Be sure to adjust the image URL paths to match your specific needs if they have changed.