🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

simple-text-search

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-text-search

A small in-memory text search that supports umlauts

1.2.0
latest
Source
npm
Version published
Weekly downloads
1.3K
40.92%
Maintainers
1
Weekly downloads
 
Created
Source

Greenkeeper badge

Usage

  var filter = require('simple-text-search')
  var get = filter(['foo', 'bar', 'foobar'])
  var results = get('foo')
  // -> returns ['foo', 'foobar']

Objects in a collection get stringified. So all properties get filtered. You can also define a property to filter in:

  var cities = [{id: 1, name: 'Zürich'}, {id: 2, name: 'Reykjavík'}]
  var get = filter(cities, 'name')
  var results = get('zurich')
  // -> returns [{id: 1, name: 'Zürich'}]

This module doesn't do any stemming except replacing umlauts.

Alternatives

Please use sifter if you need sorting or scoring.

Keywords

search

FAQs

Package last updated on 10 Jan 2024

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