Interesting... good job for a first module!

Some quick comments:

- Instead of "input.prop >= 45" you could add the support of passing a JS
function:

function(input) { return input.prop >= 45 }

But maybe you are constrained for support for Java8 and Scala
implementations (I guess they could have functional values to pass as
arguments, too)

- Instead of eval("input.prop >= 45") you could internally convert it to a
function (once):

rule.fn = new Function("input", "return input.prop >= 45")

And yes, this is the time to "me too" ;-)
https://github.com/ajlopez/SimpleRules
No README, samples, but tests
https://github.com/ajlopez/SimpleRules/blob/master/test/rule.js
https://github.com/ajlopez/SimpleRules/blob/master/test/engine.js

No priorities in rules, I'm interested in fired all suitable rules over a
given model. I'm using a fluent interface. Conditions and actions can be
defined by specific objects, or by functions. To do: when the model changes
(after an async operation, maybe triggered by an action or somethin else),
rerun any pending rules. To do: support for rule backtrack?

Personally, I prefer to have a package.json with short dev dependency list,
at least for the first iterations/versions. But I guess this is a personal
taste/decision.

Angel "Java" Lopez
@ajlopez


On Sat, Nov 22, 2014 at 5:14 AM, Ant Kutschera <[email protected]>
wrote:

> Hi,
>
> I have ported my simple rule engine from Java to Javascript and uploaded
> it to the npm registry: https://www.npmjs.org/package/maxant-rules
>
> The code is at https://github.com/maxant/rules/tree/master/rules-js and I
> would be interested in feedback since its my first node module.
>
> Thanks,
> Ant
>
>  --
> Job board: http://jobs.nodejs.org/
> New group rules:
> https://gist.github.com/othiym23/9886289#file-moderation-policy-md
> Old group rules:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> ---
> You received this message because you are subscribed to the Google Groups
> "nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/nodejs/dbd4a662-6674-4e25-bc65-d312d86cd47e%40googlegroups.com
> <https://groups.google.com/d/msgid/nodejs/dbd4a662-6674-4e25-bc65-d312d86cd47e%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/CAMs%2BDqJ2dM5QxKjnz5J9tjTmpyTLFjgt3veK5U%2BL2YocDvtCpQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to