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 🙏

© 2026 – Pkg Stats / Ryan Hefner

axel-query

v0.4.0

Published

Library for adding data safety to APIs using data driven descriptors instead of a flawed type system.

Readme

Axel Query

Library for adding data safety to APIs using data driven descriptors instead of a flawed type system.

This beta is to get something into the world that people can try, I am open to suggestions about features or more built in validators

Usage

Data Descriptors

AQ uses data descriptors instead of types in order to avoid the issues that come with type systems (type name collissions, shared schema files, etc.).

A descriptor has the following format: "<nullable?><name><array?>": <validator>

A nullable argument is an optional argument, a nullable property on the return value means that property can be null on an object instance. The array portion tells the engine if the value will be an array, and if its items are allowed to be null.

The validator is either a string naming the validator to be used, or an object describing the structure of the value. Descriptor can be nested as much as needed to describe complex structures.

Built in validators: int, number, string, bool, unsafeAny

The unsafeAny type can be used to not type check or property filter on a value, use at your own risk.

//  regular string prop
"name": "string"

//  nullable string
"?name": "string"

//  array of strings
"name[]": "string"
//  array of strings allowing null items
"name[?]": "string"

//  nested object props
"company": {
    "name": "string",
    "founded": "int",
    "ceo": {
        "name": "string"
    }
}

//  array with object items
"employees[]": {
    "name": "string",
    "title": "string"
}

Folder Structure

AQ enforces separation of functions info files by reading a directory structure to generate the api.

/*
    Files:
    +-server.js
    +-handlers
    | +-demo.js
    | +-nested
    |   +-demo.js
*/

import aqEngine from "axel-query"

//  Generates an api with "demo" and "nested.demo" functions
const service = aqEngine("handlers")
//  To use .mjs files with import/export
import engine from "axel-query/esm.mjs"

const service = engine("handlers")

Resolver Structure

AQ uses a single export with all necessary information to create and validate a function.

args is the arguments that can be passed into the function.
value is the return value of the function.
func is the function to call.

module.exports = {
    "args": {
        "?name": "string",
        "count": "int"
    },
    "value[]": {
        "name": "string",
        "files[]": "string"
    },
    func: () => {}
}
//  export structure for mjs version
export default = {
    "args": {
        "?name": "string",
        "count": "int"
    },
    "value[]": {
        "name": "string",
        "files[]": "string"
    },
    func: () => {}
}

Queries

Queries are just json objects/arrays with the functions, args, and properties to select from the return value.

Queries that are objects are run in parallel, while queries that are arrays are run in order.
Queries will return object with either a value property if no errors occured, or an error property if an exception was thrown while running the function.

//  client side
import aq from "axel-query/client"

//  parallel
await aq.run({
    "hero:characters.find": {
        args: {
            type: "hero"
        },
        value: {
            name: true,
            age: true
        }
    },
    "villain:characters.find": {
        args: {
            type: "villain"
        },
        value: {
            name: true
        }
    }
})

//  sequential
await aq.run([
    {
        "hero:characters.find": {
            args: {
                type: "hero"
            },
            value: {
                name: true,
                age: true
            }
        }
    },
    {
        "villain:characters.find": {
            args: {
                type: "villain"
            },
            value: {
                name: true
            }
        }
    }
])