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

@yoshinani/utils

v0.3.0

Published

YOSHINANI's Utility Functions Collection

Readme

YOSHINANI Utils

npm version

概要

このリポジトリは、株式会社YOSHINANIの開発で使用する汎用的なユーティリティ関数のコレクションです。

インストール

# npm を使う場合
npm i @yoshinani/utils

# pnpm を使う場合
pnpm add @yoshinani/utils

# Yarn を使う場合
yarn add @yoshinani/utils

利用可能なユーティリティ

Date Utils

日付操作に関するユーティリティ関数群です。

import { formatTimeToHHmm, formatDateToYYYYMMDD, formatDateToYYYYMMDD_HHmm } from "@yoshinani/utils/date-util"

// 時刻をHH:mm形式でフォーマット
const time = formatTimeToHHmm(new Date()) // "14:30"

// 日付をyyyyMMdd形式でフォーマット
const date = formatDateToYYYYMMDD(new Date()) // "20250814"

// 日付と時刻をyyyy年MM月dd日 HH:mm形式でフォーマット
const dateTime = formatDateToYYYYMMDD_HHmm(new Date()) // "2025年08月14日 14:30"

利用可能な関数

  • formatTimeToHHmm(time: Date): string - 時刻をHH:mm形式でフォーマット
  • formatDateToYYYYMMDD(date: Date): string - 日付をyyyyMMdd形式でフォーマット
  • formatDateToYYYYMMDD_HHmm(date: Date): string - 日付と時刻をyyyy年MM月dd日 HH:mm形式でフォーマット

String Utils

文字列操作に関するユーティリティ関数群です。

import { toFullWidth, encodeUrl } from "@yoshinani/utils/string-util"

// 半角文字列を全角に変換
const fullWidth = toFullWidth("ABC123") // "ABC123"

// 文字列をUTF-8でURLエンコード
const encoded = encodeUrl("こんにちは(世界)!") // "%E3%81%93%E3%82%93%E3%81%AB%E3%81%A1%E3%81%AF%28%E4%B8%96%E7%95%8C%29%21"

利用可能な関数

  • toFullWidth(str: string): string - 半角文字列を全角に変換
  • encodeUrl(str: string): string - 文字列をUTF-8でURLエンコード(!, (, ) も含む)

File Utils

ファイル操作に関するユーティリティ関数群です。

import { getFileExtension } from "@yoshinani/utils/file-util"

// ファイルから拡張子を取得
const file = new File([""], "example.txt")
const extension = getFileExtension(file) // "txt"

// 拡張子がない場合はTaggedErrorを返す
const invalidFile = new File([""], "example")
const result = getFileExtension(invalidFile) // TaggedError<"INVALID_FILE_EXTENSION">

利用可能な関数

  • getFileExtension(file: File): string | TaggedError<"INVALID_FILE_EXTENSION"> - ファイルから拡張子を取得

開発

ビルド

pnpm build

テスト

pnpm test

リリース

pnpm release

コントリビュート

プルリクエストを作成する前に、コントリビュートガイドをお読みください。

ライセンス

MIT