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

aries-js

v0.1.1

Published

basic rules engine

Readme

Aries

CI Job

Rules suck unless when designing system because you remember that bug that was causing clients to get denied and cost you a week of sleep? Pepperidge Farm remembers.

Don't be hip be a square and make some rules now.

Documentation

Note - You need use the defined ruleName as the key of your rule object inside the config

Possible comparisons method avaliable

CompareTwo(dataItemPath, dataItemTwoPath, operand) - Compare two values aganist eachother.

{
    ruleName: "Bounds Example",
    ...,
    dataItemPath: 'a',
    dataItemTwoPath: 'b',
    operand: '===',
    ...
}

//When using >, <, <=, >= you should use number types, strings will use the length of the string as the comparison number
{
    ruleName: "Bounds Example",
    ...,
    dataItemPath: 'a',
    dataItemTwoPath: 'b.c',
    operand: '>',
    ...
}

CompareBounds(dataItemPath, lowerBound, upperBound, operand?) - Check if a number is within a given range

//Examples
{
    ruleName: "Bounds Example",
    ...,
    lowerBound: 10,
    upperBound: 30,
    dataItemPath: 'a',
    operand: '>=', //for this type any of >=, <=, >, < these but it only checks for the = sign 
    ...           //it will always evaluate as lowerBound </= dataItem </= upperBound
}

CompareBaseline(dataItemPath, baseline, operand) - Compare a number or a list of numbers aganist of constant (baseline)

Can be used on a collection (Array<nummber>)

Will evaluate in this order dataItem operand baseline keep this in mind when defining your rule configs

{
    ruleName: "Bounds Example",
    ...,
    dataItemPath: 'a.b', //Equal 60 here
    baseline: 100,
    operand: '<=' // dataItem <= baseline or 60 <= 100 === true
}

CompareBaselineTolerance(dataItem, baseline, tolerance, operand?) - Checks if a given value is within a given tolerance,

Example

100 is greater than or equal 60 +/-10% or in number form 54 < 100 || 66 < 100

{
    ruleName: "Bounds Example",
    ...,
    dataItemPath: 'a.b', //Equal 200 here
    baseline: 100,
    tolerance: 10, // will be 10%
    operand: '<=' // baseline - 10% <= dataItem <= baseline + 10% or 90 <= 200 || 110 <= 200
}

Dependent Rules

If you need to compare some more complex information or just a larger number of data items you can chain existing rules together using dependent rules.

Accepted operators- && and ||

Example

{
ruleName: "Test Dependent Rule",
operand: "&&", // || is the only other accepted operator,
ruleNames: ["RuleOne","RuleTwo"]
}

Background

This repo is named after my dog who recently passed away. A dog who didn't listen to shit or follow the rules and I name a rule validation, seems fitting to me.

RIP buddy 2008-2020