New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

fuzzystring

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

fuzzystring

Simple fuzzy search library written in TypeScript

latest
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

fuzzystring

Simple fuzzy search library written in TypeScript

Alows partial matching of requested string. Useful for searching large sets of data without requesting acureate and full user input.

Demo

Click here for demo

screen recording 2018-12-05 at 21 35 33

Install

yarn add fuzzystring

import { fuzzyString } from 'fuzzystring';

// or if you prefer default 🤮exports
import fuzzyString from 'fuzzystring';

Api

fuzzyString('liolor', 'lorem ipsum dolor sit');

// returns
{
  parts: [
    { content: 'l', type: 'input' },
    { content: 'orem ', type: 'fuzzy' },
    { content: 'i', type: 'input' },
    { content: 'psum d', type: 'fuzzy' },
    { content: 'olor', type: 'input' },
    { content: ' sit', type: 'suggestion' },
  ],
  score: 0.87,
}

Performance

console.time('measure');
for (let i = 0; i < 100000; i++) {
  fuzzyString(`ive ${i} lles`, `i have ${i} apples`);
}
console.timeEnd('measure');
// measure: 271.169921875ms

Development

Test

yarn test

Build

yarn build

Toodo

  • Demo page
  • Solid performance test
  • Memoized cache for the same inputs
  • CI test cov etc

FAQs

Package last updated on 06 Dec 2018

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