https://github.com/yaroslavgaponov/suggester
library for create suggest index
https://github.com/yaroslavgaponov/suggester
memory-database suggestion
Last synced: 7 months ago
JSON representation
library for create suggest index
- Host: GitHub
- URL: https://github.com/yaroslavgaponov/suggester
- Owner: YaroslavGaponov
- License: other
- Created: 2015-10-09T15:52:04.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-11-11T10:21:52.000Z (almost 10 years ago)
- Last Synced: 2025-01-27T11:25:26.862Z (9 months ago)
- Topics: memory-database, suggestion
- Language: JavaScript
- Size: 258 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Suggester [](https://travis-ci.org/YaroslavGaponov/suggester)
library for create suggest index
## Usage
###### code
```js
var Suggester = require('suggester');
var suggester = new Suggester();
suggester.add('hello world');
suggester.add('hello city');
suggester.add('hello city');
suggester.add('hello city');
suggester.add('hello village');
suggester.add('hello village');
console.log(suggester.search('hell'));
```
###### result
```js
[ 'hello city', 'hello village', 'hello world' ]
```
## Example
Autocomplete for NPM packages
##### Run server
```sh
cd example\web
npm install
PORT=58468 node server.js
```
##### Wait
```sh
[gap@localhost web]$ PORT=58468 node server.js
info - socket.io started
Downloading data about packages...
Creating suggest index...
Please open http://localhost:58468
Loaded 500 docs
Loaded 1000 docs
...
```
##### Open website
```sh
xdg-open http://localhost:58468
```
##### Result

## API
[api.md](api.md)
## License
MIT Copyright (c) 2015 Yaroslav Gaponov