npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

ajoq

v0.0.70

Published

Another Javascript Object Query.

Downloads

15,184

Readme

AJOQ

Another Javascript Object Query.

Github Build Status NPM version Downloads Snyk

Uses mongodb like query structure to execute in function

Installation

npm install ajoq

Usage

Filter function

import { createFilter } from "ajoq";

interface Data {
  name: string;
  age: number;
  // data type
}
const values: Data[] = [{ name: 'John', age: 42 }, { name: 'Jane', age: 18 }];

const filterFn = createFilter<Data>({ name: 'John', age: { $gte: 21 } });
const filtered = values.filter(filterFn); // [{ name: 'John', age: 42 }]

Sort function

import { createSort } from "ajoq";

interface Data {
  name: string;
  age: number;
  // data type
}
const values: Data[] = [{ name: 'John', age: 42 }, { name: 'Jane', age: 18 }];

const sortFn = createSort<Data>({ name: 'asc', age: -1 });
const sorted = values.toSorted(sortFn); // [{ name: 'John', age: 42 }, { name: 'Jane', age: 18 }]

Documentation

Filter

The Filter type represents a flexible and expressive way to filter and search data. It supports combining conditions with logical operators, making it suitable for complex query requirements.

Logical Operators

  • $and: Matches if all sub-conditions are true (logical AND).
  • $or: Matches if at least one sub-condition is true (logical OR).
  • $nor: Matches if none of the sub-conditions are true (logical NOR).
  • $not: Matches if the sub-condition is false (logical NOT).

Filter Operators

  • $eq: Matches if the field equals the value.
  • $ne: Matches if the field does not equal the value.
  • $gt: Matches if the field is greater than the value.
  • $gte: Matches if the field is greater than or equal to the value.
  • $lt: Matches if the field is less than the value.
  • $lte: Matches if the field is less than or equal to the value.
  • $exists: Matches if the field exists or does not exist (true or false).
  • $match: Matches if the field value matches a regex or string.
  • $nmatch: Matches if the field value does not match a regex or string.
  • $bits: Matches if any bits from the field value match the specified bitmask.
  • $nbits: Matches if no bits from the field value match the specified bitmask.
  • $type: Matches if the field's type matches the specified type.
  • $ntype: Matches if the field's type does not match the specified type.
  • $in: Matches if the field value is in the specified array.
  • $nin: Matches if the field value is not in the specified array.
  • $sub: Matches if all elements of the field array are in the specified array (subset).
  • $nsub: Matches if the field array is not a subset of the specified array.
  • $sup: Matches if the field array contains all elements of the specified array (superset).
  • $nsup: Matches if the field array does not contain all elements of the specified array.
  • $con: Matches if the field array contains the specified value.
  • $ncon: Matches if the field array does not contain the specified value.

License

License The MIT License Copyright (c) 2024 Ivan Zakharchanka