0.1.0 • Published 4 years ago

wildcard-tree v0.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

wildcard-tree

A JavaScript library for searching a large array of strings in a case-invariant fashion using any number of wildcard markers.

This package was written in support of wordco.de (source).

Use

Initialize

import wildcardTree from 'wildcard-tree'

const items = ['pulled', 'from', 'dictionary'];
const tree = wildcardTree(items);

Search

// Finds six-letter words starting with 'pu'
const firstResult = tree.find('pu....');

// Finds all three-letter words
const secondResult = tree.find('...');

// Finds four-letter words starting with 'a' and ending with 'l'
const thirdResult = tree.find('a..l');

Contributing

Be sure to uptick "version" in package.json by one patch.