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

ddive-frontend-commons

v1.0.4-test1

Published

D.DIVE frontend developer's npm package

Readme

npm 주소

  • https://www.npmjs.com/package/ddive-frontend-commons

버전 관리

  • 버전 예시: 1.2.2
  • 폴더를 새로 추가 한 경우: 첫번째 자리 +1. ( 1.2.2 -> 2.0.0 )
  • 함수를 새로 추가 한 경우: 두번쨰 자리 +1. ( 1.2.2 -> 1.3.0 )
  • 기존 코드를 수정 한 경우: 세번째 자리 +1. ( 1.2.2 -> 1.2.3 )

Local에서 최초 Clone시 해야 할 것들

  • yarn install
  • prettier, eslint 관련 확장팩 설치

코드 수정 후 npm 배포 방법

  • yarn publish
  • 다음 버전 값 입력

설치방법

  • npm i ddive-frontend-commons 혹은 yarn add ddive-frontend-commons

사용방법

import { commons } from "ddive-frontend-commons";

const strArr: Array<string> = ["a", "b", "c"];

if (commons.getIsArray(strArr)) {
  // 참인 경우 실행
} else {
  // 참이 아닌 경우 실행
}

Docs

공통사항) 에러가 난 경우엔 -1, false, null, undefined, "" 등의 부정 값을 return 한다.

| commons | Return | Parameter | Description | | ---------------------------------- | ---------------------------------- | --------------------------------- | ------------------------------------------------------------------------- | | getIsArray(data) | boolean | data : any | 유효한 배열인지 체크 | | getIsDate(data) | boolean | data : any | 날짜 객체인지 체크 | | getDateDiffIndays(date1, date2) | number | date1 : any, date2: any | 두 날짜간의 차이값 반환 | | getToday() | string | | 오늘 날짜를 YYYY-mm-dd 형태의 string 값을 반환 | | getYesterday(date) | string | date : any | 넘겨 받은 날짜의 어제 날짜를 반환. | | getDateToString(date) | string | date : any | Date 객체를 넘겨받아서 YYYY-mm-dd 형태의 String 값으로 반환 | | setComma(x) | string | x : number | 넘겨받은 숫자에 1,000단위 콤마를 찍어서 반환 | | setTextLength(text, limit) | string | text : string, limit : number | 텍스트를 원하는 길이까지 자르고 마지막에 ... 을 붙여서 반환 | | getIsEmpty(value) | boolean | value : any | 모든 타입의 빈칸 체크 | | getFirstStringToUpperCase(value) | string | value : string | 첫글자 대문자로 변경 후 반환 | | setCutTimeToDate(date) | string | date : string | '2020-05-05 17:59:23' 이런 형태의 날짜 데이터에서 시간 부분을 잘라서 반환 | | setOnlyNumber(value) | number | value : string | 넘겨받은 값에서 숫자만 추출하여 반환 | | setOnlyText(value) | string | value : string | 넘겨받은 값에서 숫자와 특수문자를 제외한 텍스트만 추출하여 반환 | | getUserOs() | string | | 운영체제 확인하여 리턴해주는 함수 (pc에서만 사용) | | getUserAgent() | userAgent: string, browser: string | | 사용자의 컴퓨터 환경값을 반환 (브라우저, 기기 종류 등) |