New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

yeonpm-modules

Package Overview
Dependencies
Maintainers
0
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yeonpm-modules

Collection of frequently used functions for projects

latest
Source
npmnpm
Version
1.0.11
Version published
Maintainers
0
Created
Source

yeonpm-modules

Collection of frequently used functions for projects

Installation

npm install yeonpm-modules

Features

  • Number/String formatters
  • Colored console logging

Usage

General formatters

  • commas(1000), commas("1000")

    "1,000", "1,000"

  • capitalize("hello")

    "Hello"

  • truncate("Long text here", 5)

    "Long ..."

Date/Time formatters

  • dateForm(new Date()), dateForm(new Date(), "/")

    "2024-11-20", "2024/11/20"

  • timeForm(new Date()), timeForm(new Date(), true)

    "15:30", "15:30:00"

  • dateTimeForm(new Date()), dateTimeForm(new Date(), "/")

    "2024-11-20 15:30", "2024/11/20 15:30"

  • stringToDate("240320"), stringToDate("20240320"), stringToDate("202403201530"), stringToDate("20240320153045")

    Converts date string to Date object (Supported formats: YYMMDD, YYYYMMDD, YYYYMMDDHHMM, YYYYMMDDHHMMSS)

  • timeAgo(new Date(Date.now() - 3600000)), timeAgo(new Date(Date.now()))

    "1 hour ago", "Just now"

Logging

  • log.info("SUCCESS", "Operation completed successfully")

    "[SUCCESS] Operation completed successfully" (Colored)

Calculate

  • sum(1, 2, 3, 4, 5)

    "15"

License

MIT

Keywords

typescript

FAQs

Package last updated on 10 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts