meta-fiesta

0.0.1 • Public • Published

NPM version Build Status Dependency Status

Meta-logic for user awards (so oddly specific)

This library is an application component for a closed-source project. It takes a list of objects with a "logic" property and a single test object. Each "logic" property will be executed in sandboxed JS and passed the test object. The objects containing a "logic" that returned truthy will be passed in an arrray to a callback function.

Probably not that helpful to you...

Install

$ npm install --save meta-fiesta

Usage

var metaFiesta = require('meta-fiesta');
 
var objects = [
  { logic: "exports.main = function() { exit(test === 2);}", otherStuff: "yo" },
  { logic: "exports.main = function() {exit(test === 1);}", otherStuff: "yoyo" }
];
var test = 1;
 
metaFiesta(objects, test, function(err, list){
    console.log(list);
    //  [{ logic: "exports.main = function() {exit(test === 1);}", otherStuff: "yoyo" }]
});

License

MIT © Falkirks

Package Sidebar

Install

npm i meta-fiesta

Weekly Downloads

2

Version

0.0.1

License

MIT

Last publish

Collaborators

  • falkirks