npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@hyvip-ai/search-input

v1.0.2

Published

A simple library for search data like a wizard

Downloads

7

Readme

search-input

Brief

suppose you have an array for strings or array of objects and you want to implement some kind of search functionality where fir array of strings you will just take value from user and check if any string from that array contain it or not or for array of objects you want to check if all the values or some specific values contains the user input data, and then show the data to the user (With some design) but the thing is you will need some kind of functionality which will do the checking for you and this package do exactly what you want.

one Important thing is you can also HIGHLIGHT your searched area with this package


Import Statements

ES6

import {
  getHighlightedResultsObjectArraySomeFields,
  getResultsObjectArraySomeFields,
  getSearchResultsFromStringArray,
  highlightSearchResultsFromStringArray,
  getHighlightedResultsObjectArrayAllFields,
  getResultsObjectArrayAllFields,
} from "@hyvip-ai/search-input";

With Require

const searchInput = require("@hyvip-ai/search-input");
//use The Functions Like This
searchInput.getSearchResultsFromStringArray(args);
//or you can destructure
const { getSearchResultsFromStringArray } = require("search-input");

How to use

Search Array of String

//string related operation
import {
  getSearchResultsFromStringArray,
  highlightSearchResultsFromStringArray,
} from "@hyvip-ai/search-input";
//two arguments first one is your main array second one is a string you need to search for
let stringFilteredArray = getSearchResultsFromStringArray(
  stringArray,
  searchData
);
//after calling the function it will return an array which you can use later to display
//Highlight the search
//two arguments first one is your main array second one is a string you need to search for
let stringFilteredHighlightArray = highlightSearchResultsFromStringArray(
  stringArray,
  searchData
);
//it will also return an array bu the only difference is the array element will contain some html tags so you need to set it as innerhtml

Search Array of Objects With All Keys

//Object related operation
import {
  getHighlightedResultsObjectArrayAllFields,
  getResultsObjectArrayAllFields,
} from "@hyvip-ai/search-input";
//two arguments first one is your main array second one is a string you need to search for
let objectFilteredArray = getResultsObjectArrayAllFields(
  objectArray,
  searchData
);
//after calling the function it will return an array which you can use later to display
//Highlight the search
//two arguments first one is your main array second one is a string you need to search for
let objectFilteredHighlightArray = getHighlightedResultsObjectArrayAllFields(
  objectArray,
  searchData
);
//it will also return an array bu the only difference is the array element will contain some html tags so you need to set it as innerhtml

search Array of Objects With Some Keys

//object related operation
import {
  getHighlightedResultsObjectArraySomeFields,
  getResultsObjectArraySomeFields,
} from "@hyvip-ai/search-input";
//any number arguments are allowed first one is your main array second one is a string you need to search for and after that you have to give the key names you want search
/* if an object in an array is 
{
    capital: "Kabul"
    demonym: "Afghan"
    name: "Afghanistan"
    region: "Asia"
    subregion: "Southern Asia"
}
*/
let objectFilteredArray = getResultsObjectArraySomeFields(
  objectArray,
  searchData,
  "capital",
  "demonym"
);
//after calling the function it will return an array which you can use later to display
//Highlight the search
let objectFilteredHighlightArray = getHighlightedResultsObjectArraySomeFields(
  objectArray,
  searchData,
  "capital",
  "demonym"
);
//it will also return an array bu the only difference is the array element will contain some html tags so you need to set it as innerhtml

Search Array with Debounce

import {
  highlightSearchResultsFromStringArray,
  useDebounce,
} from "@hyvip-ai/search-input";

let answerArray = []; //array to store results
// useDebounce function takes two parameters first one is the main function and the second one is the duration between two key press, if two key is not pressed within that delay then only it will search other wise not.
let debouncedFunction = useDebounce(
  highlightSearchResultsFromStringArray, //main function
  1000 // delay in milliseconds
);

//now calling the function returned upon calling useDebounce with the same arguments as shown in previous example
//debouncedFunction returns an array which will only resolved upon getting some search value as far now there is no use of catch here but it may change in future.
debouncedFunction(stringArray, searchItem).then((data) => {
  //storing the data
  answerArray = data;
});

This package is still under development and will be released with new and improved functions , if you find any problems whule using this or if you have any new ideas for integration please feel free to reach out @[email protected] or in LinkedIn