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-swisskit

v1.0.6

Published

Tổng hợp cách tool tiện ích thuận lợi cho việc phát triển dự án về ReactJS, NextJS

Downloads

12

Readme

Description

react-swisskit is a collection of tools, validators to solve problems in Front End programming with ReactJS and NextJS

# npm install react-swisskit
# yarn add react-swisskit

Features

Usage

handleSort

import {handleSort} from "react-swisskit";
const list = [8, 9, 8, 5, 7, 4, 5, 2, 4, 4, 5, 4, 7];
handleSort(list);
console.log(list);
==>[ 5, 8, 8, 9 ]

const students = [
  { name: "Hoài Nam", age: 20 },
  { name: "jessica", age: 30 },
  { name: "Tony toàn", age: 82 },
];
handleSort(students, "age");
console.log(students);
==> [
  { name: 'Hoài Nam', age: 20 },
  { name: 'jessica', age: 30 },
  { name: 'Tony toàn', age: 82 }
]

Validator

import { Validator } from "react-swisskit";

console.log(Validator.isEmail("namagmail.com")); // false
console.log(Validator.isEmail("[email protected]")); //true

and more ...
 emailRegex
 phoneRegex
 imageRegex
 filePath
 isPhone
 isEmail
 isMinlength
 isMaxLength
 isImageExtend

Debounced

import { Debounced } from "react-swisskit";

const handleSerach = () => {
  console.log("Delay 200ms");
};
Debounced(handleSerach, 200);

[Debounced Demo][https://blog.zecky.online/debounce-toi-uu-hoa-cong-cu-tim-kiem-trong-reactjs] And more read...."# library"

cn

  • cn have format class in tailwindcss
import { cn } from "react-swisskit";

EX1:
<p className={cn("px-2 py-2","mt-2 mb-2")}> Format Class TailWindCss</p>
-->--------------------
 View HTML  <p class="p-2 my-2">Format Class TailWindCss</>

EX2:
const isAdmin=true;

<p className={cn("title_format-red",isAdmin?"text-red-300":"text-yellow-300")}> Trnarye operator to format class </p>
-->--------------------
 View HTML  <p class="p-2 my-2">Format Class TailWindCss</>

coverSlug

import { coverSlug } from "react-swisskit";

coverSlug("toi yeu   em qua  "); // toi-yeu-em
coverSlug("qua dai @#2 dsasda khơ  "); // qua-dai-kho
coverSlug("Điện thoại nè  "); // dien-thoai-ne

capitalizeText

import { capitalizeText } from "react-swisskit";

capitalizeText("toi yeu   em qua  "); // Tôi Yêu Em
capitalizeText("phạm hoài Nam  "); // Phạm Hoài Nam

removeVietnameseTones

import { removeVietnameseTones } from "react-swisskit";

removeVietnameseTones("Sài thư viện này đi xịn lắm "); // Sai thu vien nay di xin lam
removeVietnameseTones("phạm hoài Nam  "); // pham hoai Nam