# sfilter

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

Latest version **1.0.2** (published 2015-10-21) · ISC license · 0 weekly downloads

## Install

```sh
npm install sfilter
pnpm add sfilter
yarn add sfilter
bun add sfilter
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2015-10-21 |
| First published | 2015-10-21 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Ali Reza |
| Maintainers | alileza |

## Links

- npm: https://www.npmjs.com/package/sfilter
- Repository: https://github.com/alileza/sfilter
- Issues: https://github.com/alileza/sfilter/issues
- npm.io page: https://npm.io/package/sfilter

## Dependencies (1)

- [coffee-script](https://npm.io/package/coffee-script.md) ^1.10.0

## Recent versions

- 1.0.2 (latest) — 2015-10-21
- 1.0.1 — 2015-10-21
- 1.0.0 — 2015-10-21

## README

# SFilterJS

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

## Example
```html
<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
```sh
npm install sfilter --save
```
On NodeJS you have to initialize the SFilter object before you can use it.
```javascript
var sfilter = new SFilter();
sfilter.setResource(["a","b"]);
```

### using Browser
```sh
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.
```javascript
// all resources must be string, and not an object
SFilter.setResources(["Javascript", "Hack-lang", "Go-lang"]);
```
### Set Limit
Limit the response of SFilter find
```javascript
// Set response limit
SFilter.setLimit(2);
```

### Find
Find similar string on the resources
```javascript
// Get the response
SFilter.find("Jvscrpth");
```
## Test
coming soon

---
_Source: https://npm.io/package/sfilter · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
