Skip to content

IRaccoonI/taxios

 
 

Repository files navigation

taxios

TypeScript wrapper over Axios.

Use

Install packages.

npm i axios @simplesmiler/taxios
npm i -D @simplesmiler/taxios-generate

Generate typings with @simplesmiler/taxios-generate.

npx taxios-generate -o PetStore.ts -e PetStore https://petstore.swagger.io/v2/swagger.json

Use typings with @simplesmiler/taxios.

import axios from 'axios';
import { Taxios } from '@simplesmiler/taxios';

// Import generated typings
import { PetStore } from './PetStore';

// Create axios client and taxios wrapper
const taxios = new Taxios<PetStore>(axios.create({ baseURL: 'https://petstore.swagger.io/v2' }));

// Make request
const pet = await taxios.get('/pet/{petId}', { params: { petId: 1 } });

Develop

  1. Clone repo
  2. npm i
  3. npm run bootstrap
  4. Change something in taxios or taxios-generate package
  5. Test by running scripts in taxios-sandbox packages

Publish

  1. npm run build
  2. npm run publish

About

Typed wrapper over axios

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 58.8%
  • JavaScript 41.2%