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

@gateweb/react-utils

v2.7.4

Published

React Utils for GateWeb

Readme

@gateweb/react-utils

@gateweb/react-utils 是 GateWeb 的 TypeScript-first utility library,包含常用的 functions / hooks / types(日期、格式化、轉換、驗證、web、React hooks 等),並且有測試與自動化文件。

This repo also provides a docs site + auto-generated API reference.

npm version

✨ Features

  • React Hooks: A collection of useful hooks like useCountdown and useValue.
  • Date Utilities: Powerful and flexible functions for handling dates and time periods, built on top of dayjs.
  • Core Helpers: A wide range of utilities for type conversion (bytes, searchParams), case style formatting, object manipulation, and more.
  • Web APIs: Simplified functions for common web tasks like file downloads (download) and managing browser storage (webStorage).
  • Validation: A set of predefined regex patterns and validation functions for common data types.
  • TypeScript First: Fully written in TypeScript, providing excellent type safety and autocompletion out of the box.
  • Lightweight & Tree-Shakable: Built with bunchee to ensure minimal bundle size.

📦 Installation

# With pnpm (recommended)
pnpm add @gateweb/react-utils

# With npm
npm install @gateweb/react-utils

# With yarn
yarn add @gateweb/react-utils

🚀 快速開始(Quick Start)

import { bytesToSize } from '@gateweb/react-utils';

bytesToSize(1024);

更多範例與用法請看 react-utils docs

🤝 Contributing

Contributions are welcome! To ensure a smooth development process, please follow these steps:

  1. Fork & Clone: Fork the repository and clone it to your local machine.

  2. Set Up: This project uses pnpm as the package manager. Install dependencies with:

    pnpm install
  3. Develop: Create a new branch for your feature or bug fix.

  4. Test: Write tests for your changes and ensure all existing tests pass.

    # Run all tests
    pnpm test
    
    # Run tests in watch mode
    pnpm test:watch
  5. Submit a Pull Request: Push your changes to your fork and open a pull request to the main branch. Your code will be automatically linted and formatted upon commit.

Publishing (For Maintainers)

Manual Release

  1. Update the version in package.json.
  2. Install dependencies and build the package:
    pnpm install && pnpm build
  3. Log in to npm:
    pnpm login
  4. Publish the package:
    pnpm publish --access public --no-git-checks

Automatic Release

When a pull request is merged into the main branch, the release GitHub Action will automatically bump the version, create a changelog, and publish the new version to npm. The version bump follows Semantic Versioning based on the commit messages (e.g., feat: for minor, fix: for patch).