0.0.1 • Published 3 years ago

@binhbv/finder v0.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

finder

This project is a clone of @medv/finder with some modifications to make it work CommonJS environments.

Install

npm install @binhbv/finder

Usage

// commonjs
const { finder } = require('@binhbv/finder');

// es6
import { finder } from '@binhbv/finder';

Configuration

finder takes configuration object as second parameters. Here is example of all params with default values:

const selector = finder(event.target, {
  root: document.body,
  idName: (name) => true,
  className: (name) => true,
  tagName: (name) => true,
  attr: (name, value) => false,
  seedMinLength: 1,
  optimizedMinLength: 2,
  threshold: 1000,
  maxNumberOfTries: 10_000,
});