Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sfilter

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sfilter

SFilter is lightweight (1.5KB) javascript library for searching through array with fault tolerant.

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

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");
		// Return should be ["Javascript", "Coffeescript", "Swift", "C", "Java"]
		// Sorted by most similar words
		
</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.

// all resources must be string, and not an object
SFilter.setResources(["Javascript", "Hack-lang", "Go-lang"]);

Set Limit

Limit the response of SFilter find

// Set response limit
SFilter.setLimit(2);

Find

Find similar string on the resources

// Get the response
SFilter.find("Jvscrpth");

Test

coming soon

FAQs

Package last updated on 21 Oct 2015

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc