@hyunbinseo/tools
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

Tools by Hyunbin

Fully typed JavaScript utilities with ESM and CJS support. Module List

Usage

Node.js

npm i @hyunbinseo/tools
pnpm i @hyunbinseo/tools
// Reference the following section for the full module list.
import { dateToSafeISOString, generatePINString } from '@hyunbinseo/tools';

Browser

// Reference the following section for the full module list.
// The major version number MUST be specified in the pathname.
import {} from 'https://cdn.jsdelivr.net/npm/@hyunbinseo/tools@0.1/dist/index.js';

Modules

Date to Safe ISO String

Timestamp string that can be safely used in filename, directory name, etc.

dateToSafeISOString(); // Uses the current time (e.g. 20240402T020408.248Z)
dateToSafeIsoString(new Date('2024-05-26T00:00+09:00')); // 20240525T150000.000Z

// The outputted string CANNOT be used in JavaScript.
new Date('20240525T150000.000Z'); // Invalid Date

Generate PIN String

Truly random number string using the Crypto.getRandomValues() method.

generatePINString(); // 270136
generatePinString(8); // 39534786

Readme

Keywords

none

Package Sidebar

Install

npm i @hyunbinseo/tools

Weekly Downloads

3

Version

0.1.0

License

MIT

Unpacked Size

6.24 kB

Total Files

7

Last publish

Collaborators

  • hyunbinseo