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 🙏

© 2024 – Pkg Stats / Ryan Hefner

rulezb

v0.0.5

Published

A Business Rule Engine for rule them all

Downloads

7

Readme

rulezb

A Business Rule Engine for rule them all

version: 0.0.5

Business Rules Engine is a kind of software developed to support environments where the rules changes in a regular base like risk evaluation, text analysis, data mining and others softwares designed to decision making.

This kind of job need support this changes without high costs per change.

So, BRE - Business Rule Engines are effective designs to this problem.

This BRE are under develop to support rules in string format, functions and methods. This will provide the use of external datasources to validation.

how to test:

show the help node rulezb.js -h Rulez A Business Rule Engine for rule them all. parameters: -d run as a deamon (optional) -p port number (optional) default: 2001 -r ruleset name.(optional) -f fact data in a json format. by Ivo Nascimento [iannsp at gmail . com].

node rulezb.js -r test1 -f '{"sexo":"masculino","idade":30}' // return 1  

node rulezb.js -r test1 -f '{"sexo":"masculino","idade":5}' // return 0 

What is a a fact?

A Fact is a data record with all expected information for a bre. Its represented in JSON format.

What is a RuleSet?

A rule set is setting of rules to apply over the fact.

How to create a Rule Set?

To create a ruleset you need add a file with the same name in the ruleset folder. The format of this file is. Example for a ruleset named as test1:

exports.test1 = { // you need export the ruleset to become visible to Rulez Engine.
    returnType:"boolean", // this is a returnType you expect. Right now just support boolean but, Score, and data 
    rules:[ // this is a array with all rules
            'data.sexo =="masculino"',  // this is a javascript syntax where data is the JSON Fact.
            function(data){return (data.idade >10);} // You can create rules in function format where data is the JSON Fact you provide
        ]
};

changeLog

0.0.1: Test the ideia in run string rules(A rule described in logical statements).

0.0.2: Support more complex logic into the rules supporting function as a rule.

0.0.3: Support nested rules and the use of functions as ReturnType.

0.0.4: Support to 'expr' type as ReturnType. An evaluable instruction with a result.

0.0.5: Support daemon -d mode.

// how to use node rulezb.js -d -p 3000 -r returnTypeExpression