
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
FluORM is a fluent, model-oriented, typed REST client for TypeScript.
FluORM is a lightweight and flexible Object-Relational Mapping (ORM) library for TypeScript/JavaScript applications. It provides a simple and intuitive way to interact with your API endpoints while maintaining type safety and following object-oriented principles.
npm install fluorm
Run tests
npm test
Before using FluORM, you need to configure it with your API base URL and optional interceptors:
import { FluORM } from 'fluorm';
FluORM.configure({
baseUrl: 'https://api.example.com',
// Optional interceptors
requestInterceptor: (request) => {
// Modify request before sending
return request;
},
responseInterceptor: (response) => {
// Modify response before returning
return response;
},
errorInterceptor: (error) => {
// Handle errors
console.error(error);
}
});
Models are the core of FluORM. Here's how to create a model:
import { Model, Attributes } from 'fluorm';
interface IUser extends Attributes {
name: string;
email: string;
created_at?: string;
updated_at?: string;
}
export class User extends Model<IUser> {
static resource = 'users'; // The API endpoint for this model
}
FluORM provides several decorators to define relationships and type casting:
import { HasOne, HasMany, BelongsTo, BelongsToMany } from 'fluorm';
class User extends Model<IUser> {
@HasOne(() => Profile)
declare profile: Relation<Profile>;
@HasMany(() => Post)
declare posts: Relation<Post[]>;
@BelongsTo(() => Team)
declare team: Relation<Team>;
@BelongsToMany(() => Role)
declare roles: Relation<Role[]>;
}
import { Cast } from 'fluorm';
class User extends Model<IUser> {
@Cast(() => Date)
created_at?: Date;
@Cast(() => Thumbnail)
thumbnail?: Thumbnail;
@Cast(() => Thumbnail)
thumbnails?: Thumbnail[];
}
Scopes allow you to define reusable query constraints:
class User extends Model<IUser> {
static scopes = {
active: () => ({ status: 'active' }),
verified: () => ({ email_verified: true }),
// Custom scope with parameters
ageRange: (min: number, max: number) => ({
age: { $gte: min, $lte: max }
})
};
}
Models come with several static methods for querying and manipulating data:
all(): Get all recordsfind(id): Find a record by IDcreate(data): Create a new recordupdate(id, data): Update a recorddelete(id): Delete a recordfirstOrCreate(where, createData): Find first record or create if not foundupdateOrCreate(where, updateData): Update first record or create if not foundquery(): Start a new query builderwhere(conditions): Add where conditionsfilter(filters): Add filter conditionsinclude(relations): Include related modelsExample usage:
// Get all users
const users = await User.all();
// Find user by ID
const user = await User.find(1);
// Create new user
const newUser = await User.create({
name: 'John Doe',
email: 'john@example.com'
});
// Update user
await User.update(1, { name: 'Jane Doe' });
// Delete user
await User.delete(1);
// Query with conditions
const activeUsers = await User.where({ status: 'active' }).all();
// Include related models
const userWithPosts = await User.include('posts').find(1);
Model instances have the following methods:
save(): Create or update the recordupdate(data): Update the recorddelete(): Delete the recordExample usage:
const user = new User({
name: 'John Doe',
email: 'john@example.com'
});
// Save new user
await user.save();
// Update user
user.name = 'Jane Doe';
await user.update();
// Delete user
await user.delete();
MIT
FAQs
FluORM is a fluent, model-oriented, typed REST client for TypeScript.
The npm package flurorm receives a total of 0 weekly downloads. As such, flurorm popularity was classified as not popular.
We found that flurorm demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.