Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fuzzyjs

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fuzzyjs

Fuzzy.js is a fuzzy search algorithm in javascript

  • 2.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.1K
decreased by-4.79%
Maintainers
1
Weekly downloads
 
Created
Source

fuzzyjs

Build Status Coverage Status

fuzzyjs is a fuzzy search algorithm in javascript. It fits in 577 bytes compressed (~400 bytes gzipped).

License

fuzzyjs is licensed under MIT License.

Usage

// Basic true/false test
fuzzy.test('li', 'lorem ipsum'); // true
fuzzy.test('li', 'Lorem ipsum', true); // false

// Advanced match with surrounding and score
fuzzy.match('li', 'lorem ipsum');
// { score: 0.2857, result: 'lorem ipsum' }

fuzzy.match('Li', 'Lorem ipsum', {
    caseSensitive: true,
    before: '<span>',
    after: '</span>'
});
// { score: 0.2857, result: '<span>L</span>orem <span>i</span>psum' }

// Filter an array using match (array is sorted based on score)
const arr = ['lorem ipsum', 'foo', 'the li element'];
fuzzy.filter('li', arr, { caseSensitive: true, before: '<span>', after: '</span>' });
/*
[
    'the <span>l</span><span>i</span> element',
    '<span>l</span>orem <span>i</span>psum'
]
*/

Keywords

FAQs

Package last updated on 26 Apr 2016

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc