https://github.com/apacheli/dragapi
Deno bindings for PokéAPI.
https://github.com/apacheli/dragapi
deno javascript library pokeapi pokemon typescript
Last synced: about 2 months ago
JSON representation
Deno bindings for PokéAPI.
- Host: GitHub
- URL: https://github.com/apacheli/dragapi
- Owner: apacheli
- License: other
- Created: 2021-10-03T02:00:52.000Z (over 4 years ago)
- Default Branch: dev
- Last Pushed: 2023-08-09T08:35:52.000Z (almost 3 years ago)
- Last Synced: 2025-02-10T14:09:58.991Z (over 1 year ago)
- Topics: deno, javascript, library, pokeapi, pokemon, typescript
- Language: TypeScript
- Homepage:
- Size: 36.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# dragapi
### About
Deno bindings for [PokéAPI](https://pokeapi.co/).
See the generated documentation
[here](https://doc.deno.land/https/github.com/apacheli/dragapi/raw/dev/mod.ts).
All types provided by dragapi are referenced from the PokéAPI documentation.
### Example
Make sure to enable `--allow-net`.
```ts
import { getPokemon } from "https://github.com/apacheli/dragapi/raw/dev/mod.ts";
const input = prompt("Enter the ID or name of a Pokémon:");
if (input) {
try {
console.log(await getPokemon(input));
} catch {
console.log("Couldn't find that Pokémon...");
}
} else {
console.log(
"You provided no input. Please try again! (use ctrl+c to exit)",
);
}
```