Pomo
import { Pomo } from "https://raw.githubusercontent.com/EthanThatOneKid/pomo/main/mod.ts";
A Pomo is a cycle of work and break periods.
class Pomo { }
public get eternal(): boolean;
§Properties
§Methods
§Static Methods
§
fromPattern(options: PatternOptions): Pomo
[src]Create a pomo from a pattern.
Example:
// Options for creating a pomo from a pattern
const pattern = "25w5b"; // 25 minutes of work, 5 minutes of break
const dayLength = DAY; // 1 day in milliseconds
const ref = new Date(new Date().setHours(0, 0, 0, 0)).valueOf(); // Previous midnight
const scale = MINUTE; // Scale minutes in pattern to milliseconds
const pomo = Pomo.fromPattern({
pattern, // required
dayLength, // required
ref, // required
scale, // default = 1
});
const stamp = pomo.at(new Date().valueOf());
console.log(format(stamp.timeout, "HH:mm:ss.SSS"));