
Security News
OpenClaw Skill Marketplace Emerges as Active Malware Vector
Security researchers report widespread abuse of OpenClaw skills to deliver info-stealing malware, exposing a new supply chain risk as agent ecosystems scale.
Keep an array of objects indexed by field, for super-fast retrieval.
Have you ever created an array, filled it with objects, and then wanted to sometimes
retrieve the objects based on "id", but sometimes based on "slug"? Did you simple
create a find(key, value) method? That's okay, I've done it too. Just keep reading
though, you'll love this module.
Reol lets you create an array of objects pretty much like you've always done, but you can also specify fields to be indexed. The advantage of indexes is that retrieving an object based on the value of an indexed field is a lot faster.
About twice as fast for tiny arrays (10 elements) and infintely faster for large (10000 elements) arrays.
See this jsperf test for exact data and to verify in your own environment.
Node npm install reol --save
Bower bower install reol
Others may simply copy index.js and put it where you like it. Reol should work
in all js environments, including commonJS (node) and AMD (requireJS) as well as
old-fashioned <script src="dist/reol.min.js"></script>-style.
Compatibility note: Reol depends on a global JSON object. Use a polyfill if you wish to support older browsers (<IE8).
// Supports deep indexes
var list = new Heap({
test: true,
'parent.child': true
});
// Chain adds if you feel like it
list.add({
test: 'meow',
parent: {
child: 'baahh'
}
});
// Indexing works even with undefined and complex values, though the latter is not recommended
list.add({
test: function(){
console.log("seriously try to not do this");
}
});
// Un-indexed fields also work
list.add({
woot: 'mooo'
});
// Find all matches
list.find({ test: 'meow' });
// findOne will speed up best-case scenarios for queries on un-indexed fields
list.findOne({ woot: 'mooo' });
Current version does not support non-unique indexes or queries on multiple fields. This will be added, see Todo.
Ordered by likeliness and simpleness to implement.
I just threw this together in a few hours to solve my problem at hand. If you want to pick something on the todo list or have an opinion on how some method should be implemented (or maybe not implemented at all), please don't hestitate to create an issue, submit a pull request, tweet/email me or whatever.
For example I'm at the moment not sure if I should keep Raol as a very small and basic utility or extend it with rather complex (but some might argue essential) functionality such as .remove() and advanced indexing.
MIT
FAQs
Keep an array of objects indexed by field, for super-fast retrieval.
The npm package reol receives a total of 1 weekly downloads. As such, reol popularity was classified as not popular.
We found that reol demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Security researchers report widespread abuse of OpenClaw skills to deliver info-stealing malware, exposing a new supply chain risk as agent ecosystems scale.

Security News
Claude Opus 4.6 has uncovered more than 500 open source vulnerabilities, raising new considerations for disclosure, triage, and patching at scale.

Research
/Security News
Malicious dYdX client packages were published to npm and PyPI after a maintainer compromise, enabling wallet credential theft and remote code execution.