@buttercup/search
v0.2.0
Published
Vault searching components
Downloads
6
Readme
Search
Vault searching components
About
This library provides searching utilities for finding entries in Buttercup vaults.
Usage
Use the extraction methods to extract search targets from vaults:
const { extractEntriesFromArchive } = require("@buttercup/search");
const searchItems = extractEntriesFromArchive(vault);
Or vault facades:
const { extractEntriesFromArchiveFacade } = require("@buttercup/search");
const searchItems = extractEntriesFromArchiveFacade(vaultFacade);
Provide these results to the Search
class:
const { Search } = require("@buttercup/search");
const search = new Search(searchItems);
search.on("results", evt => {
// evt is like:
// {
// results: [],
// term: "some term"
// }
});
search.update("some term");
Check out the API documentation for more information.