tapi.js
TypeScript icon, indicating that this package has built-in type declarations

0.5.1 • Public • Published
   __              _     _     
  / /_____ _____  (_)   (_)____
 / __/ __ `/ __ \/ /   / / ___/
/ /_/ /_/ / /_/ / /   / (__  ) 
\__/\__,_/ .___/_(_)_/ /____/  
        /_/       /___/        
	

Consume APIs as typed objects!

License TS Dependencies Stars

ko-fi

Imagine doing this...

http
  .get('/some-url-that-returns-an-object') // Get data 📡
  .as(YourClass) // Map it onto your class ✨
  .then((builtObject) => {
    builtObject.doSomething(); // Use it directly 🎉
  })

Or even this...

const builtObject = await http.get('/some-url-that-returns-an-object').as(YourClass)
builtObject.doSomething();

How?

Introducing tapi, a tiny TypeScript package used to define how to interpret any given API response as a typed object.

It automatically converts JSON objects into TypeScript class instances, however you can still configure it however you want with Aliases, Transformers, Mappers and more.



More info

📦 Check it out on npm

🦕 Check it out on deno

😱 Check it out on Bundlephobia

Use directly from the browser

📚 Additional info on the file on libraries.io

Big thanks to anyone who contributes!

You could be here! Just follow the contributor's guide.

👇

Contributors


Thanks for using tapi! 😊 I hope it's been useful to you in some way.

Package Sidebar

Install

npm i tapi.js

Homepage

tapi.js.org

Weekly Downloads

13

Version

0.5.1

License

GPL-3.0-only

Unpacked Size

419 kB

Total Files

24

Last publish

Collaborators

  • sinisimattia