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

@uxbooster/utils

v1.0.10

Published

Utility functions for UXBooster.

Readme

@uxbooster/utils

이 패키지는 일반적으로 사용되는 유틸리티 함수들의 모음입니다.

설치

npm install @uxbooster/utils

사용법

import { isArray, isString } from '@uxbooster/utils';

console.log(isArray([])); // true
console.log(isString('hello')); // true

함수 목록

이 패키지에서 제공하는 함수 목록은 다음과 같습니다.

| 함수 이름 | 설명 | 예제 | | -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | intersection | 두 배열 간의 교집합을 계산하는 함수. | intersection([1, 2, 3], [2, 3, 4]); // [2, 3] | | not | 두 배열 간의 차집합을 계산하는 함수. | not([1, 2, 3], [2, 3, 4]); // [1] | | maskName | 주어진 이름 문자열을 마스킹하여 반환합니다. | maskName('테이크'); // "테*크" | | maskPhoneNumber | 주어진 전화번호 문자열을 마스킹하여 반환합니다. | maskPhoneNumber('010-1234-5678'); // "010-****-5678" | | commaizeNumber | 숫자를 입력받아 3자리마다 콤마(,)를 추가한 문자열로 반환합니다. | commaizeNumber(1234567); // "1,234,567" | | decommaizeNumber | 콤마(,)가 포함된 문자열을 숫자로 변환합니다. | decommaizeNumber("1,234,567"); // 1234567 | | floorAndFormatNumber | 주어진 숫자를 내림(floor) 처리하고 콤마를 포함한 형식의 문자열로 반환합니다. | floorAndFormatNumber(12345.67); // "12,345" | | ceilToUnit | 주어진 숫자를 올림하여 특정 단위로 포맷하는 함수입니다. | ceilToUnit(320980, 10000); // 330000 | | floorToUnit | 주어진 숫자를 내림하여 특정 단위로 포맷하는 함수입니다. | floorToUnit(1234.56, 10); // 1230 | | roundToUnit | 주어진 숫자를 반올림하여 특정 단위로 포맷하는 함수입니다. | roundToUnit(320980, 1000); // 321000 | | formatToKoreanNumber | 숫자를 한글 단위로 포맷합니다. | formatToKoreanNumber(1234567); // "123만 4,567" | | formatToKRW | 숫자를 한글로 변환하여 원화를 포함한 포맷으로 변환하는 함수입니다. | formatToKRW(13209802); // "1,320만 9,802원" | | format | 문자열 내의 포맷 지정된 플레이스홀더를 대체합니다. | format('Hello, {0}!', ['John']); // 'Hello, John!' | | isJsonString | 주어진 문자열이 JSON 형식인지 확인합니다. | isJsonString('{ "key": "value" }'); // true | | parseJson | 주어진 문자열을 JSON 객체로 파싱합니다. | parseJson('{"name": "Take", "age": 3}'); // { name: 'Take', age: 3 } | | replaceDynamicSegments | 메뉴 URL에서 Next.js의 동적 세그먼트([param], [...param], [[...param]])를 실제 값으로 대체합니다. | replaceDynamicSegments("/post/[id]", '{"id":"123"}'); // '/post/123' | | toCamelCase | 문자열을 Camel case로 변환합니다. | toCamelCase('hello world'); // helloWorld | | toPascalCase | 문자열을 Pascal case로 변환합니다. | toPascalCase('hello world'); // HelloWorld | | toRestfulFormat | 문자열을 RESTful API에서 사용 가능한 형태로 변환합니다. | toRestfulFormat('hello world'); // hello-world | | toSnakeCase | 문자열을 스네이크 케이스로 변환합니다. | toSnakeCase('hello world'); // hello_world | | copyObject | 객체를 복사하여 동일한 내용을 가진 새로운 객체를 반환합니다. | copyObject({ id: 1, name: "Alice", age: 25 }); // 결과: { id: 1, name: "Alice", age: 25 } | | decode | 입력된 값 또는 수식을 검사해 적절한 값을 반환합니다. | decode("1", "1", "One", "2", "Two", "Default"); // 결과: "One" | | formatBytes | 바이트 크기를 형식화된 문자열로 변환합니다. | formatBytes(1024); // '1 KB' | | generateUUID | 고유한 UUID(Universally Unique Identifier)를 생성합입니다. | generateUUID(); // 'e89b9a5b-ff59-4c34-923b-7367b4a5b321' | | getAge | 주어진 생년월일(YYMMDD)로 만 나이를 계산합니다. | getAge("990101"); // 25 (2024년 10월 1일 기준) | | getType | 주어진 객체의 타입을 문자열로 반환합니다. | getType('hello'); // 'String' | | isArray | 주어진 값이 배열인지 확인합니다. | isArray([1, 2, 3]); // true | | isBoolean | 주어진 값이 부울형인지 확인합니다. | isBoolean(true); // true | | isEmpty | 주어진 값이 비어 있는지 확인합니다. | isEmpty(null); // true | | isFunction | 주어진 값이 함수인지 확인합니다. | isFunction(() => {}); // true | | isInt | 주어진 값이 정수인지 확인합니다. | isInt(123); // true | | isMobileDevice | 사용자가 모바일 기기에서 접속했는지 여부를 확인합니다. | isMobileDevice(); // true | | isNull | 주어진 값이 undefined 또는 null인지 확인합니다. | isNull(null); // true | | isNumber | 주어진 값이 숫자인지 확인합니다. | isNumber(123); // true | | isObject | 주어진 값이 객체인지 확인합니다. | isObject({}); // true | | isString | 주어진 값이 문자열인지 확인합니다. | isString('hello'); // true | | isUndefined | 주어진 값이 undefined인지 확인합니다. | isUndefined(undefined); // true | | jwtDecode | JWT 문자열을 디코딩하여 헤더 또는 페이로드를 반환하는 함수입니다. | jwtDecode('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c'); // { "sub": "1234567890", "name": "John Doe", "iat": 1516239022 } | | nvl | 주어진 값이 undefined, null, 또는 빈 문자열인 경우 대체값을 반환합니다. | nvl(undefined, 'default'); // 'default' | | toBoolean | 입력된 값을 boolean으로 변환합니다. | toBoolean('true'); // true | | toInt | 입력된 값이 숫자로 변환 가능한지 확인하고, 가능한 경우 정수로 변환합니다. | toInt('123'); // 123 | | toString | 주어진 값의 문자열 표현을 반환합니다. | toString(123); // '123' |

클래스 목록

이 패키지에서 제공하는 클래스 목록은 다음과 같습니다.

  • StorageItem: 로컬 스토리지에 저장된 데이터 항목을 나타내는 클래스입니다.
  • LocalStorageWorker: 브라우저의 로컬 스토리지를 사용하여 데이터를 저장하고 관리하기 위한 클래스입니다.
  • CredentialStorage: 브라우저의 로컬 스토리지를 사용하여 사용자의 로그인 정보를 저장하고 관리하는 클래스입니다.