fluent-criteria
v1.3.0
Published
Another package implementing a criteria pattern, this with a fluent interface
Downloads
16
Maintainers
Readme
📥 Installation
npm i fluent-criteria
🕹️ Playground
https://stackblitz.com/edit/fluent-criteria-example
📖 Usage
import { FluentCriteria } from 'fluent-criteria';
import { IUser, users } from './users.dataset';
const criteria = new FluentCriteria<IUser>();
const usersWithEmail = criteria.search.email.defined.find(users);
console.log('Users with email: ', usersWithEmail);
const usersAsAdmin = criteria.search.role.equal('admin').find(users);
console.log('Users that are admin: ', usersAsAdmin);
const usersWithThumbnailWithPixels =
criteria.search.profile.thumbnail.pixels.defined.find(users);
console.log('Users with thumbnail and pixels: ', usersWithThumbnailWithPixels);
📦 Packages
📦 CommonJS
const { FluentCriteria } = require('fluent-criteria');
📦 ESM
import { FluentCriteria } from 'fluent-criteria';
📦 TypeScript
import { FluentCriteria } from 'fluent-criteria';
📝 License
This project is licensed under the GNU AFFERO GENERAL PUBLIC LICENSE
- see the LICENSE file for details