pokesprite-fetcher
v1.0.0
Published
A Vue component to fetch and display Pokemon sprites from PokeAPI
Maintainers
Readme
Pokemon Sprite Fetcher
A Vue 3 component package for fetching and displaying Pokemon sprites from the PokeAPI.
Features
- 🎮 Text input for Pokemon name
- 🔍 Validates Pokemon names using PokeAPI
- 🖼️ Fetches and displays Pokemon sprites
- ❌ Clear error messages for invalid Pokemon names
- 🎨 Styled and ready to use
- 📦 Easy to import and integrate
Installation
npm install pokesprite-fetcherUsage
In a Vue 3 project
<template>
<div>
<h1>My Pokemon App</h1>
<PokemonSpriteFetcher />
</div>
</template>
<script>
import PokemonSpriteFetcher from 'pokesprite-fetcher';
import 'pokesprite-fetcher/style.css';
export default {
components: {
PokemonSpriteFetcher
}
}
</script>With Composition API
<script setup>
import PokemonSpriteFetcher from 'pokesprite-fetcher';
import 'pokesprite-fetcher/style.css';
</script>
<template>
<PokemonSpriteFetcher />
</template>How it Works
- User enters a Pokemon name in the text input
- Clicks "Fetch Sprite" button (or presses Enter)
- Component validates the name using PokeAPI
- If valid, displays the Pokemon sprite and name
- If invalid, shows an error message
Development
Install dependencies
npm installBuild the package
npm run buildDevelopment mode
npm run devPublishing to NPM
- Update the version in
package.json - Build the package:
npm run build - Login to npm (if not already logged in):
npm login - Publish the package:
npm publish
API
The component uses the PokeAPI to fetch Pokemon data. No API key is required.
License
MIT
Author
Your Name
