diff --git a/README.md b/README.md index a6d46c7d..8575ade5 100644 --- a/README.md +++ b/README.md @@ -23,39 +23,13 @@ pnpm add axios axios-cache-interceptor pokenode-ts ## Basic Example -Using a client, like PokemonClient: - ```ts -import { PokemonClient } from 'pokenode-ts'; - -(async () => { - const api = new PokemonClient(); - - try { - const pokemonData = await api.getPokemonByName('luxray'); - console.log(pokemonData.name); // Outputs "Luxray" - } catch (error) { - console.error(error); - } -})(); +import { PokemonClient } from 'pokenode-ts'; // Import the Client -``` - -Or, using the MainClient: +const pokemon = await api.getPokemonByName('luxray') // Make the request + .catch(() => console.log("Oops!")); -```ts -import { MainClient } from 'pokenode-ts'; - -(async () => { - const api = new MainClient(); - - try { - const pokemonData = await api.pokemon.getPokemonByName('luxray'); - console.log(pokemonData.name); // Outputs "Luxray" - } catch (error) { - console.error(error); - } -})(); +console.log(pokemon.name); // Typesafe response ✨ (Outputs "Luxray") ``` ## Documentation