New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

fuzzy-glob

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

fuzzy-glob

Fuzzy search in file system.

  • 0.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-87.5%
Maintainers
1
Weekly downloads
 
Created
Source

fuzzy-glob

Fuzzy-search in file system. Like quick-open in Visual Studio Code.

Install

$ npm install --save fuzzy-glob

Usage

const fuzzyGlob = require('fuzzy-glob');

/*
  Assume we have a directory named `src` contains bunches of files.
  src
  ├── a.js
  ├── b.js
  └── sub
      ├── c.js
      └── d.js
*/

const fuse = fuzzyGlob('./src/**/*');

// We can find files like `c.js` and `d.js` by fuzzy searching the related word `sub`
fuse.search('sub');
/*
> [{
    file: '/Users/Paul/src/sub'
  }, {
    file: '/Users/Paul/src/sub/c.js'
  }, {
    file: '/Users/Paul/src/sub/d.js'
  }]
*/

// Or ignore directory matches by passing `nodir` to option.
fuse.search('sub', { nodir: true });
/*
> [{
    file: '/Users/Paul/src/sub/c.js'
  }, {
    file: '/Users/Paul/src/sub/d.js'
  }]
*/


// We also can use tokens for matching.
fuse.search('sub d');
/*
> [{
    file: '/Users/Paul/src/sub/d.js'
  }]
*/

License

MIT © Paul Young

Keywords

FAQs

Package last updated on 16 May 2017

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