ichigyou (一行 = "one line" in Japanese) is a carefully curated collection of 54+ concise, battle-tested utility functions written as elegant TypeScript one-liners. Stop reinventing the wheel—use functions that are:
| Category | Functions | Examples |
|---|---|---|
| String | 18 functions | isValidEmail, toTitleCase, isPalindrome, countWords |
| Array | 13 functions | removeDuplicated, intersection, minMax, isSubset |
| Number | 23 functions | isPrime, fibonacci, gcd, median, factorial |
| Object | Utilities | Deep merge, flatten, and more |
| Other | Helpers | Date, validation, and misc utilities |
# npm
npm i ichigyou
# yarn
yarn add ichigyou
# pnpm
pnpm i ichigyou
# bun
bun install ichigyou
import {
isValidEmail,
removeDuplicated,
isPrime,
fibonacci
} from 'ichigyou'
// String utilities
isValidEmail('user@example.com') // true
toTitleCase('hello world') // 'Hello World'
// Array utilities
removeDuplicated([1, 2, 2, 3, 3, 4]) // [1, 2, 3, 4]
intersection([1, 2, 3], [2, 3, 4]) // [2, 3]
// Number utilities
isPrime(17) // true
fibonacciMemo(10) // 55
gcd(48, 18) // 6
median([1, 2, 3, 4, 5]) // 3
isValidEmail(email: string): boolean
isValidURL(url: string): boolean
toTitleCase(str: string): string
isPalindrome(str: string): boolean
removeVowels(str: string): string
isAnagram(str1: string, str2: string): boolean
removeDuplicated<T>(arr: T[]): T[]
intersection<T>(arr1: T[], arr2: T[]): T[] | null
minMax(arr: number[]): { min: number, max: number }
hasUniqueValues<T>(arr: T[]): boolean
isSubset<T>(arr1: T[], arr2: T[]): boolean
isPrime(num: number): boolean
fibonacciMemo(n: number): number
gcd(num1: number, num2: number): number
lcm(num1: number, num2: number): number
factorial(num: number): number
median(arr: number[]): number
standardDeviation(arr: number[]): number
Full API documentation with detailed examples is available at:
👉 https://koji.github.io/ichigyou/index.html
👉 mintlify document
Contributions are welcome! If you have a useful one-liner function to add:
git checkout -b feature/amazing-function)git commit -m 'Add amazing function')git push origin feature/amazing-function)MIT © Koji Kanao
If ichigyou saved you time and keystrokes, give it a star! ⭐