Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@mdmonu/fast-search

MMonu014MIT1.0.2

A lightweight and efficient JavaScript package for quickly finding the index of a target number in an array.

fast search, array search, find index, binary search, efficient search, quick lookup, search algorithm, optimized search, number search, element index, array utilities, lightweight search, performance optimization, JavaScript search, find element in array

readme

🚀 Fast Search

🔍 Overview

Fast Search is a lightweight and efficient JavaScript package designed to quickly find the index of a target number within a sorted array.

📦 Installation

Install the package using npm or yarn:

npm install fast-search
# or
yarn add fast-search

🚀 Usage

Import findIndex from fast-search and use it to locate the index of a target element in an array.

const { findIndex } = require("fast-search");

const targetElement = 7;
const arr = [1, 2, 3, 4, 5, 6, 7, 8, 9];

const targetIndex = findIndex(arr, targetElement);

console.log(targetIndex); // Output: 6

📌 Features

  • 🔥 Fast & Efficient: Optimized search for quick results.
  • 🛠 Lightweight: Minimal dependencies, keeping your project clean.
  • 🎯 Easy to Use: Simple API with a single function.

📝 API

findIndex(array, target)

Finds the index of target in array. If the target is not found, returns -1.

Parameters:

  • array (Array): The array to search within.
  • target (Number): The number to find in the array.

Returns:

  • (Number): The index of the target element, or -1 if not found.

🤝 Contributing

We welcome contributions! Feel free to open issues or submit pull requests.

📜 License

This project is licensed under the MIT License.


⭐ If you find this package useful, consider giving it a star!