SFilterJS
SFilter is lightweight (1.5KB) javascript library for searching through array with fault tolerant.
Example
<script src="/dist/sfilter.js"></script>
<script>
SFilter.setResources(["Javascript", "Hack-lang", "Go-lang", "Coffeescript", "PHP", "Ruby", "Swift", "Python", "Perl", "Java", "Scala", "Clojure", "Erlang", "Elixir", "C", "C++", "C#"]);
SFilter.find("jvscript");
</script>
Installation
using NPM
npm install sfilter --save
On NodeJS you have to initialize the SFilter object before you can use it.
var sfilter = new SFilter();
sfilter.setResource(["a","b"]);
using Browser
git clone git@github.com:alileza/sfilter.git
cd sfilter
open example.html
Docs
Set Resources
Array list is called as Resources, for the array of object will be supported soon.
SFilter.setResources(["Javascript", "Hack-lang", "Go-lang"]);
Set Limit
Limit the response of SFilter find
SFilter.setLimit(2);
Find
Find similar string on the resources
SFilter.find("Jvscrpth");
Test
coming soon