Coder Social home page Coder Social logo

marco4413 / iq.js Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 35 KB

An Iterable Querying library.

Home Page: https://marco4413.github.io/iq.js/

License: MIT License

JavaScript 90.97% HTML 9.03%
es6-modules iterable iterable-api javascript javascript-library js-module jsdocs npm npm-package query query-builder typedefs

iq.js's Introduction

iq.js

About

This JavaScript library adds a Query system for Iterables.

You can even query your own fridge! (as long as it's iterable)

import * as iq from "iq.js";

const fridge = [
    {
        itemName: "cheese",
        expiryDate: new Date("2024-01-15")
    },
    {
        itemName: "milk",
        expiryDate: new Date("2024-01-17")
    }
];

const todayDate = new Date("2024-01-16");
const query = iq.query()
    .where(c => c.expiryDate.getTime() <= todayDate.getTime())
    .select("itemName")
    .build();

query.on(fridge).foreach(console.log);
fridge.push({
    itemName: "fish sticks",
    expiryDate: new Date("2024-01-16")
});
query.extend()
    .map(s => s.toUpperCase())
    .on(fridge)
    .foreach(console.log);

You can start feeling like a REAL web DEVELOPER TODAY!

For real, this was a cool idea that came to mind, it's not supposed to be fast and/or efficient. Though it makes for some cool readable code.

Examples

Examples can be tried within this repo's GitHub Pages Website.

iq.js's People

Contributors

marco4413 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.