New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

prose-clock

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prose-clock

Intelligible time: an alternative to digital and analog formats

  • 2.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-66.67%
Maintainers
1
Weekly downloads
 
Created
Source

prose-clock

What Time Is It?

We've seen digital clocks. Boring. We've seen analog time pieces. Quaintly geometric. In the world of text-based communication, we expect a timely and prosaic declaration.

An Alternative to Digital or Analog

prose-clock displays the time in the manner of a spoken English colloquial expression. It's aware of the notions of morning, afternoon, and night, thus keeping AM vs. PM unambiguous.

Installation

npm i prose-clock

Usage

1. Import the Module

import { ProseClock } from 'prose-clock';

2. Instantiate with or without language style option

Default is conventional, idiomatic English. Set the style in the consructor to 'curse' or 'regular' (regular is default).

If 'curse' is used, the time is also expressed in English, but the text is occasionally laced with colorful slang.

// Two ways to instantiate
const pc = new ProseClock();
const pc = new ProseClock('curse');
3. Get the time, expressed in text
pc.getTime(); // --> "exactly twenty to eight at night"

Default is current time. However, you can optionally pass in a Date object:

const d = new Date();
d.setHours(12, 45);
pc.getTime(d); // --> "exactly quarter to one in the afternoon"

Notes

In this module's world, granularity is a minute. It would undermine the philosophy of ProseClock to display, for example, "just after five past nine in the morning and twenty-four seconds."

Suggestion

Enhance your app; wrap pc.getTime() in a setInterval() call, configured to run every 20 seconds.

Have fun!

Gerry Gold

August 2023

Keywords

FAQs

Package last updated on 15 Aug 2023

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc