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

@simplysm/core-common

v13.0.67

Published

심플리즘 패키지 - 코어 모듈 (common)

Readme

@simplysm/core-common

A common utility package for the Simplysm framework. As a neutral base module usable in both Node.js and browser environments, it provides date/time types, error classes, object/array/string utilities, JSON serialization, ZIP processing, prototype extensions, and more.

Installation

npm install @simplysm/core-common
# or
pnpm add @simplysm/core-common

Initialization

Import the package at your application entry point (e.g., index.ts, main.ts):

import "@simplysm/core-common";

This import globally activates Array, Map, and Set prototype extensions. To use extension methods (getOrCreate(), toggle(), etc.), you must import this at app startup.

Main Modules

Errors

Custom Types

  • DateTime - Date + time (millisecond precision, local timezone)
  • DateOnly - Date only (no time)
  • Time - Time only (no date, 24-hour cycle)
  • Uuid - UUID v4 (cryptographically secure)
  • LazyGcMap - Map with auto-expiration (LRU style)

Features

ZIP

  • ZipArchive - ZIP file compression/decompression utility

Object Utilities

JSON Utilities

  • jsonStringify - JSON serialization with custom type support
  • jsonParse - JSON deserialization with custom type restoration

XML Utilities

String Utilities

Number Utilities

Date/Time Formatting

Byte Utilities

Async Wait

Worker Data Conversion

Path Utilities

Template Literal Tags

  • js - JavaScript code highlighting
  • ts - TypeScript code highlighting
  • html - HTML markup highlighting
  • tsql - MSSQL T-SQL highlighting
  • mysql - MySQL SQL highlighting
  • pgsql - PostgreSQL SQL highlighting

Other Utilities

Array Extensions

Query

  • single - Return single element (error if 2+)
  • first - Return first element
  • last - Return last element

Filtering

Mapping/Transformation

Grouping

Deduplication

Sorting

Comparison/Merging

Aggregation

Mutation

  • insert - Insert at specific position
  • remove - Remove item or items matching predicate
  • toggle - Toggle item
  • clear - Remove all items
  • shuffle - Shuffle array

Map Extensions

Set Extensions

  • adds - Add multiple values at once
  • toggle - Toggle value (add/remove/force)

Types

Caveats

Prototype Extension Conflicts

This package extends Array, Map, and Set prototypes. Conflicts may occur when used with other libraries that extend the same method names. In case of conflict, the last defined implementation is applied based on load order.

Timezone Handling

When using DateOnly.parse(), DateTime.parse():

  • yyyy-MM-dd, yyyyMMdd format: parse directly from string (no timezone influence)
  • ISO 8601 format (2024-01-15T00:00:00Z): interpret as UTC then convert to local

When server and client timezones differ, actively use yyyy-MM-dd format.

Memory Management (LazyGcMap)

LazyGcMap has an internal GC timer, so it must be cleaned up.

// using statement (recommended)
// gcInterval: GC execution interval (ms), expireTime: item expiration time (ms)
using map = new LazyGcMap({ gcInterval: 10000, expireTime: 60000 }); // GC every 10 seconds, expire after 60 seconds

// Or explicit dispose() call
const map = new LazyGcMap({ gcInterval: 10000, expireTime: 60000 }); // GC every 10 seconds, expire after 60 seconds
try {
  // ... use
} finally {
  map.dispose();
}

jsonStringify's type Reserved Word

jsonStringify/jsonParse uses objects with __type__ and data keys for type restoration. Be careful as user data in the form { __type__: "DateTime", data: "..." } may be unintentionally type-converted.

Circular References

  • objClone: supports circular references (tracked with WeakMap)
  • jsonStringify: throws TypeError on circular reference
  • transferableEncode: throws TypeError on circular reference (includes path information)

License

Apache-2.0