Searching an ORM alike tool
for your APIs interactions?
Foscia is like an ORM, but for APIs consumption. You can easily get started and interact with your standardized APIs without thinking about serialization and error handling complexity.
const posts = await action()
.use(query(Post), include('author'))
.run(all());
const post = fill(new Post(), {
title: 'Hello World!',
});
await action()
.use(create(post))
.run(one());
Readable data models
Type safety with TypeScript
Foscia provides an elegant way to define your data models. It gives your data structure readability and type safety across all your data interactions, even accros nested relations.
export default class Post
extends makeModel('posts', {
publishable,
title: attr<string>(),
body: attr<string>(),
author: hasOne(() => User),
tags: hasMany(() => Tag),
}) {
}
Modular, lightweight, and more...
HTTP·REST·JSON:API
Exchange with any HTTP, REST or JSON:API backend.
Modular
Simple configuration and framework-agnostic.
Lightweight
Fully tree-shakable for optimal build size.
Type safe
Strong type your data structure with TS.
Changes tracking
Record changes on data during lifecycle.
Hooks
Register hooks, such as saving or deleting.
Cache
Never re-fetch data thanks to the cache system.
CLI
Get started quickly with the built-in CLI.
Get started now
Install Foscia CLI
Foscia CLI allow you to quickly setup Foscia on your project. It will automatically detect your environment and install required Foscia packages. Once installed, just run init
command with your destination directory.
- NPM
- YARN
- PNPM
- Bun
npm install --save-dev @foscia/cli
yarn add -D @foscia/cli
pnpm add -D @foscia/cli
bun add -D @foscia/cli
- NPM
- YARN
- PNPM
- Bun
npx foscia init
yarn foscia init
pnpm foscia init
bun foscia init