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 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-tsuki

v1.0.1

Published

A versatile React component library with utility hooks and functions, built with TypeScript.

Downloads

3

Readme

react-tsuki react-tsuki react-tsuki

Introduction

react-tsuki is a versatile React component library with utility hooks and functions, built with TypeScript. It aims to provide developers with reusable, well-tested components and utilities to streamline their development process.

Features

  • React Components: A set of reusable, customizable React components.
  • Utility Hooks: A collection of custom hooks to simplify state management and side effects in React.
  • Utility Functions: Handy utility functions for common programming tasks.
  • TypeScript Support: Fully typed with TypeScript to enhance developer experience and code quality.

Installation

You can install react-tsuki via npm or yarn:

npm install react-tsuki

or

yarn add react-tsuki

Usage

React Components

Import and use the available components in your React application.

import { Button } from "react-tsuki";

const App = () => (
  <div>
    <Button label="Click Me" onClick={() => alert("Button clicked!")} />
  </div>
);

Utility Hooks

Leverage custom hooks to manage state and side effects efficiently.

useFetch

import { useFetch } from "react-tsuki/hooks";

const FetchComponent = () => {
  const { data, loading, error } = useFetch("https://api.example.com/data");

  if (loading) return <p>Loading...</p>;
  if (error) return <p>Error: {error.message}</p>;

  return <div>{JSON.stringify(data)}</div>;
};

Utility Functions

Utilize the provided utility functions to handle common tasks.

capitalize

import { capitalize } from "react-tsuki/utils";

const text = "hello world";
const capitalizedText = capitalize(text);
console.log(capitalizedText); // Output: Hello world

Available Hooks

•	useToggle: Toggle boolean state.
•	useLocalStorage: Sync state with localStorage.
•	usePrevious: Get the previous state value.
•	useWindowSize: Get window dimensions.
•	useFetch: Fetch data with loading and error states.
•	usePost: Send POST requests.
•	useDelete: Send DELETE requests.
•	usePut: Send PUT requests.
•	usePatch: Send PATCH requests.
•	useGet: Send GET requests.
•	useFetchWithCancel: Fetch data with cancellation.
•	useRetryFetch: Retry fetch on failure.
•	useFetchOnMount: Fetch data on mount.
•	useFetchInterval: Fetch data at intervals.
•	useClickOutside: Detect clicks outside an element.
•	useDebouncedValue: Debounce a value.
•	useHover: Detect hover state.

Available Utilities

•	capitalize: Capitalize the first letter of a string.
•	deepClone: Deep clone an object.
•	debounce: Debounce a function.
•	throttle: Throttle a function.
•	formatDate: Format a date.
•	mergeObjects: Merge multiple objects recursively.
•	isEmpty: Check if an object or array is empty.
•	randomString: Generate a random string.

Contributing

Contributions are welcome! Please open an issue or submit a pull request on GitHub.

License

This project is licensed under the MIT License.

Enjoy building with react-tsuki! 🎉