@binhbv/finder
v0.0.1
Published
CSS Selector Generator
Downloads
9
Readme
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,
});