Socket
Book a DemoInstallSign in
Socket

pokeapi-types

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pokeapi-types

TypeScript type definitions for [PokeAPI v2](https://pokeapi.co/docs/v2)

latest
npmnpm
Version
0.0.2
Version published
Maintainers
1
Created
Source

pokeapi-ts

TypeScript type definitions for PokeAPI v2

Install

$ yarn add -DE pokeapi-types

Usage

This package contains only type definitions and no runtime code. All type definitions are available under the named exported symbol PokeAPI.

Example: getting pokemon info for ditto using /api/v2/pokemon/{id_or_name}

import { PokeAPI } from "pokeapi-types";

async function getPokemon(idOrName: string): Promise<PokeAPI.Pokemon> {
    const url = `https://pokeapi.co/api/v2/pokemon/${idOrName}`;
    const response = await fetch(url);
    return await response.json();
}

// const ditto = await getPokemon("ditto");

FAQs

Package last updated on 22 Jul 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts