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

chronoflex-formatter

v1.0.0

Published

Flexible date formatter returning Date objects with multiple format utilities

Readme

⏱️ chronoflex-formatter

A lightweight and flexible date utility library that returns Date objects with powerful formatting helpers.

Supports:

✅ ESM & CommonJS ✅ Multiple date variants (startOfDay, endOfMonth, etc.) ✅ Custom formatting tokens ✅ Zero dependencies ✅ TypeScript support


📦 Installation

npm install chronoflex-formatter

🚀 Usage

✅ ESM (Modern)

import { now, iso, variants } from "chronoflex-formatter";

const date = now();

console.log(date);                 // Date object
console.log(iso(date));            // ISO string
console.log(variants(date).startOfDay);

✅ CommonJS

const chrono = require("chronoflex-formatter");

const date = chrono.now();

console.log(date);
console.log(chrono.iso(date));

📅 Core Functions

Get Current Date

import { now } from "chronoflex-formatter";

const date = now(); // Date object

Clone Date

import { clone } from "chronoflex-formatter";

const copy = clone(date);

🧠 Date Variants (Return Date Objects)

import { variants } from "chronoflex-formatter";

const v = variants();

console.log(v.original);
console.log(v.startOfDay);
console.log(v.endOfDay);
console.log(v.startOfMonth);
console.log(v.endOfMonth);
console.log(v.startOfYear);
console.log(v.endOfYear);

All values returned are Date objects, not strings.


🧩 Date Parts

import { parts } from "chronoflex-formatter";

const p = parts();

console.log(p.year);
console.log(p.month);
console.log(p.day);
console.log(p.hours);

🎨 Formatting Functions

ISO Format

import { iso } from "chronoflex-formatter";

iso(); 
// 2026-02-17T10:20:30.000Z

Local Format

import { local } from "chronoflex-formatter";

local();
// 17/02/2026, 3:50:30 pm

12 Hour Time

import { time12 } from "chronoflex-formatter";

time12();
// 03:50:30 PM

24 Hour Time

import { time24 } from "chronoflex-formatter";

time24();
// 15:50:30

Custom Format

Supported tokens:

| Token | Meaning | | ----- | ---------- | | YYYY | Year | | MM | Month | | DD | Day | | HH | Hours (24) | | mm | Minutes | | ss | Seconds |

Example:

import { custom } from "chronoflex-formatter";

custom("YYYY-MM-DD HH:mm:ss");
// 2026-02-17 15:50:30

💡 Why chronoflex-formatter?

Unlike many libraries that return only strings, this package:

✅ Keeps Date object integrity ✅ Gives multiple derived dates instantly ✅ Simple API ✅ No heavy dependencies

Perfect for:

  • Backend services
  • Logging systems
  • Scheduling apps
  • Microservices timestamps
  • Angular / React / Node projects

⚡ TypeScript Support

Types are included automatically.

import { now } from "chronoflex-formatter";

const date: Date = now();

🔮 Roadmap

Planned features:

  • Timezone support
  • Relative time (5 minutes ago)
  • Immutable date wrapper
  • Duration utilities
  • Angular Pipe support

🤝 Contributing

Contributions are welcome!

  1. Fork repo
  2. Create feature branch
  3. Commit changes
  4. Open PR

📄 License

MIT License © 2026


⭐ Support

If you like this project, please give it a ⭐ on GitHub.