Registry / productivity / tinytime

tinytime

JSON →
library0.2.6jsnpmunverified

A straightforward date and time formatter in <800b (current version 0.2.6). It has no dependencies, uses an AST-based template approach for efficiency, and provides a minimal set of formatting tokens. Unlike moment.js or date-fns, it focuses on size and simplicity, but is no longer actively maintained.

npm install tinytime
INSTALL
IMPORT
SIG · TINYTIME
T
tinytime
productivityjavascriptv0.2.6
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import tinytime from 'tinytime'
const tinytime = require('tinytime')
ESM-only; no CommonJS export.
tinytime
import { tinytime } from 'tinytime'
import tinytime from 'tinytime'
The default export is the function itself; there is no named export.
template.render
const template = tinytime('{h}:{mm}'); template.render(new Date())
tinytime('{h}:{mm}').render(new Date())
Creating a new template on every render is inefficient; reuse the template object.

Shows basic usage: import, create template, render with a Date object.

import tinytime from 'tinytime'; const template = tinytime('{h}:{mm}{a} on {MMMM} {Do}, {YYYY}'); console.log(template.render(new Date())); // Example output: "11:10PM on September 24th, 1992"
Debug
Known issues
deprecatedPackage is no longer actively maintained; last release 0.2.6 in 2017.
fix
Consider using date-fns or dayjs for active development.
affects: *
gotchaNo support for timezone or locale; always uses local browser/Node timezone.
fix
Use a library like luxon for timezone support.
affects: *
gotchaCreating templates inside render calls (e.g., in React) causes performance issues.
fix
Create template once outside render, then call .render(date).
affects: *
breakingAll versions are ESM only; no CommonJS export.
fix
Use import syntax or a bundler that supports ESM.
affects: *
Errors
Common errors & fixes
Cannot find module 'tinytime'
Missing npm install or wrong import path.
fix
Run 'npm install tinytime' and use 'import tinytime from 'tinytime''.
TypeError: tinytime is not a function
Incorrect import style (e.g., destructuring or using require).
fix
Use default import: import tinytime from 'tinytime'.
Uncaught ReferenceError: tinytime is not defined
Using tinytime in a browser without bundling or script tag.
fix
Bundle with webpack/rollup or use a CDN that supports ESM.
Template token '{h}' not recognized
Typo in template string; tokens must be exact and wrapped in braces.
fix
Use correct tokens: {h}, {H}, {mm}, {ss}, {a}, {MMMM}, etc.
Upgrade
Version history
0.2.6latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
27 hits · last 30 days
node
26
OpenAI (training)
1
Resources
tinytime — npm install tinytime · libregistry