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

useutils-dexterverse

v1.1.9

Published

It is a package which conatins multiple usefull functions used for basic logic work.

Readme

dexterverse_logo

⚡ Util Functions and Hooks (Dexterverse)

useutils-dexterverse is a utility library designed to simplify and streamline common tasks for developers. It offers a variety of utility functions for working. Also new util functions are currently being added.

📦 Installation

To install and set up the library, run:

npm i useutils-dexterverse

🏷️ Util Functions/Hooks Categories

📊 Array Sorting Util Functions

The Array Sorting utility functions in useutils-dexterverse provide multiple methods to sort arrays efficiently based on different criteria. These functions allow for sorting arrays, making it easy to organize data in ascending or descending order.

1. useBubbleSortOptimized()

useBubbleSortOptimized() is an improved version of the traditional Bubble Sort algorithm. It sorts an array of numbers or strings in ascending/descending order. The function optimizes performance by checking if any swaps occur during a single pass. If no swaps are made, the array is already sorted, and the function terminates early.

//importing syntax
import { useBubbleSortOptimized } from 'useutils-dexterverse';
//implementing syntax
console.log("log-->", useBubbleSortOptimized([654,6,10,5,-1]));

Output - log--> [-1, 5, 6, 10, 654]

⚠️ Note - Arguments are to be send with proper order.

type arguments = {
  arr: (string | number)[]; // Array of strings or numbers
  reverse?: boolean;        // Optional: Sort in reverse order
}

💰 Currency Converter Util Functions

The Currency Converter utility functions in useutils-dexterverse provide an easy and efficient way to convert string, number, or float values into different currency formats according to different countries.

1. useCurrencyFormatter()

The useCurrencyFormatter() utilizes the Intl.NumberFormat API, which is an inbuilt feature in JavaScript for internationalizing and formatting numbers, including currencies. It ensures proper currency formatting based on locale and currency codes.

//importing syntax
import { useCurrencyFormatter } from "useutils-dexterverse";
//implementing syntax
console.log("log-->",useCurrencyFormatter(123456, "India"));

Output - log--> ₹1,23,456.00

⚠️ Note - Arguments are to be send with proper order.

type Arguments = {
  value: number | `${number}`;           // A number or numeric string to be formatted
  country: CountryName;                  // Country name or locale for currency formatting
  options?: Intl.NumberFormatOptions;    // Optional: Additional Intl.NumberFormat options
};

⏳ Debounce Util Function

The Debounce utility function in useutils-dexterverse helps in optimizing event handling by preventing a function from being executed too frequently. It ensures that the function is called only after a specified delay has passed since the last invocation, making it useful for search bars, input fields, and window resize events.

1. useCurrencyFormatter()

useDebounce() ensures that a function is executed only after a given delay, even if it is triggered multiple times in rapid succession. This prevents unnecessary API calls or computations.

// full Usage
import { View, Text, Button, TextInput } from 'react-native';
import React, { useState } from 'react';
import UseApiHookContextStore from './context/UseApiHookContextStore';
import { useDebounceFunc } from "useutils-dexterverse";

const App = () => {

  // Create debounced functions once
  const debouncedSearch2000 = useDebounceFunc(() => {
    console.log("Call logic after 2 second of value change.");
  }, 2000);

  const debouncedSearch3000 = useDebounceFunc(() => {
    console.log("Call logic after 5 second of value change.");
  }, 5000);


  return (
    <View>
      <Text>Search Bar</Text>

      <TextInput
        onChangeText={(text) => {
          // Call debounced function
          debouncedSearch2000(); 
        }}
      />

      <TextInput
        onChangeText={(text) => {
          debouncedSearch3000(); // Call debounced function
        }}
      />
    </View>
  )
}

export default App

⚠️ Note

  • Always declare useDebounceFunc above the return statement inside the functional component. Do not call it inside event handlers (e.g., onChangeText), loops, or conditionals, as it will cause an "Invalid hook call" error.

⏳ Throttle Util Function

The Throttle utility function in useutils-dexterverse ensures that a function is executed at most once within a given time interval. This is useful for optimizing performance in scenarios like button clicks, API calls, and window resize events.

1. useThrottleFunc()

useThrottleFunc() returns a throttled function that, when called repeatedly, ensures the actual function execution happens only once within the defined interval.

// full Usage
import { View, Text, Button } from 'react-native';
import React from 'react';
import { useThrottleFunc } from "useutils-dexterverse";

const App = () => {
  // Create throttled functions
  const throttledSubmit5000 = useThrottleFunc(() => {
    console.log("Hit API at 2 sec interval.");
  }, 2000);

  const throttledSubmit8000 = useThrottleFunc(() => {
    console.log("Hit API at 4 sec interval.");
  }, 4000);

  return (
    <View>
      <Text>Submit Button</Text>

      <Button
        title='Call Submit API (5s)'
        onPress={throttledSubmit5000} // Correct way to call
      />

      <Button
        title='Call Submit API (8s)'
        onPress={throttledSubmit8000} // Correct way to call
      />
    </View>
  );
};

export default App;

⚠️ Note

  • The useThrottleFunc must be initialized above the return statement in functional components.
  • Calling it directly inside event handlers (like onPress) will cause an invalid hook call error.

📅 Date Time Formatter Util Function

The useDateTimeFormatter() function allows you to format JavaScript Date objects into various human-readable formats.

1. useDateTimeFormatter()

Formats a given date into the specified format.

// import
import { useDateTimeFormatter } from 'useutils-dexterverse'
// // 🚀 Example Usage
// Using current date
console.log(useDateTimeFormatter(new Date(), "DD/MM/YYYY HH:mm"));

// Using a custom date
console.log(useDateTimeFormatter(new Date("2024-05-15T14:45:00"), "DD/MM/YYYY HH:mm"));

//second argument suggests all available formats so don't worry
// output
20/02/2025 15:30  // Example output for current date
15/05/2024 14:45  // Example output for custom date

🔒 Masked Data Util Function

The useMaskedData() function helps mask sensitive data, such as emails and phone numbers, for privacy and security.

1. useMaskedData()

Masks portions of a string to hide sensitive information.

// import
import { useMaskedData } from 'useutils-dexterverse'
// // 🚀 Example Usage
// Masked Email
  var maskedEmail = useMaskedData(
    "[email protected]",
    "email",
    {
      maskChar: "*",
      maskBefore: true,
      maskAfter: true,
      visibleStart: 2,
      visibleEnd: 5,
    });
  console.log(maskedEmail);

  // Masked Number
  var maskedNumber = useMaskedData(
    "9876543210",
    "mobile",
    {
      maskChar: "*",
      visibleStart: 2,
      visibleEnd: 2
    });
  console.log(maskedNumber);

  // Masked Card
  var maskedCard = useMaskedData(
    "1234567812345678",
    "card",
    {
      maskChar: "#",
      visibleStart: 0,
      visibleEnd: 4
    });
  console.log(maskedCard);
// output
jo******@gmail****  //Email
98******10          //Mobile Number
############5678    //Card

📜 License

MIT License

👨‍💻 Authors

🚀 About Me

I'm a react native developer.

💬 Feedback

If you have any feedback, please mail at [email protected].