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

@jin7942/utils

v1.0.0

Published

자주 사용하는 로거, 파일 유틸을 모은 경량화 TypeScript 유틸리티 모음

Downloads

4

Readme

@jin7942/utils

npm version npm downloads license

파일 시스템 작업 및 로깅 기능을 지원하는 경량 유틸리티 모듈입니다.
CLI 도구, 배포 도구, 자동화 스크립트 등에 사용하기 좋도록 설계되었습니다.


설치

npm install @jin7942/utils

문서

DOCUMENT

제공 기능

파일 유틸 (fsHelper)

| 함수 | 설명 | | ---------------------------------- | --------------------------------------------- | | ensureDirectoryExists(path) | 지정한 디렉토리가 없으면 재귀적으로 생성 | | appendToFile(dir, file, content) | 파일에 로그 추가, 로그 용량 초과 시 자동 정리 | | readFile(path) | 파일 내용을 UTF-8로 읽어 문자열 반환 | | exists(path) | 해당 경로의 파일 존재 여부를 boolean으로 반환 |


로깅 유틸 (logger)

  • 콘솔 출력 + 파일 저장 지원
  • 로그 레벨 필터링 (info / warn / error)
  • ANSI 컬러 지원 (터미널 가독성 강화)

| 메서드 | 설명 | | ------------------- | ---------------------------------------------- | | logger.info(msg) | 녹색 [INFO] 로그 출력 | | logger.warn(msg) | 노란색 [WARN] 로그 출력 | | logger.error(msg) | 빨간색 [ERROR] 로그 출력 (Error 객체도 지원) |

로그 파일은 날짜 기준(YYYY-MM-DD.log)으로 저장됩니다.
기본 저장 경로는 'logs'이며, .env 또는 logConfig.ts로 설정 가능합니다.


예시

import { logger } from '@jin7942/utils';
import { appendToFile, ensureDirectoryExists } from '@jin7942/utils';

logger.info('작업 시작');
await ensureDirectoryExists('./data');
await appendToFile('./data', 'log.txt', '첫 번째 로그입니다');

⚙ 환경 변수 (.env 또는 process.env)

| 변수명 | 설명 | 기본값 | | -------------- | ------------------------ | --------- | | LOG_DIR | 로그 저장 디렉터리 | logs | | LOG_MAX_SIZE | 최대 디렉터리 용량(byte) | 5242880 | | LOG_LEVEL | 출력 로그 레벨 | info |


라이선스

MIT


제작자