# nanosearch

> A tiny search engine.

Latest version **1.0.0** (published 2022-08-09) · BSD-3-Clause license · 0 weekly downloads

## Install

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

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2022-08-09 |
| First published | 2022-08-09 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 25.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 13 |
| Author | Daniel Lindsley |
| Maintainers | toastdriven |
| Keywords | search, n-gram, engine |

## Links

- npm: https://www.npmjs.com/package/nanosearch
- Repository: https://github.com/toastdriven/nanosearch
- Homepage: https://github.com/toastdriven/nanosearch#readme
- Issues: https://github.com/toastdriven/nanosearch/issues
- npm.io page: https://npm.io/package/nanosearch

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2022-08-09

## README

# `nanosearch`

A tiny search engine.

Suitable for in-browser use, this provides n-gram based search results.


## Quickstart

```js
import { SearchEngine } from '@toastdriven/nanosearch';

// Create a search engine.
const engine = new SearchEngine();

// Index some documents.
// First parameter is the unique document ID, second is the document text.
engine.add("abc", "The dog is a 'hot dog'.");
engine.add("def", "Dogs > Cats");
engine.add("ghi", "the quick brown fox jumps over the lazy dog");
engine.add("jkl", "Am I lazy, or just work smart?");

// Then, you can let the user search on the engine...
engine.search("my dog");
// ...including limiting results (to just one)...
engine.search("lazy", 1);
// ...or a second page of ten results!
engine.search("dogs", 10, 2);
```


## Installation

`$ npm install @toastdriven/nanosearch`


## Requirements

* ES6 (or similar translation/polyfill)


## Tests

```shell
$ git clone git@github.com:toastdriven/nanosearch.git
$ cd nanosearch
$ npm install
$ npm test
```


## Docs

```shell
$ git clone git@github.com:toastdriven/nanosearch.git
$ cd nanosearch
$ npm install
$ ./node_modules/.bin/jsdoc -r -d ~/Desktop/out --package package.json --readme README.md src
```


## License

New BSD

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