A software documentation review with first run, task guide, exact reference, explanation, original source and checked command cases
HTML for this example
Select the code and use your copy shortcut. Changes in this preview are temporary.
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src 'unsafe-inline'; form-action 'none'; base-uri 'none'"><title>clock-minutes - software documentation</title><style>*{box-sizing:border-box}body{margin:0;font:16px/1.5 Arial,Helvetica,sans-serif;color:#24313b;background:#fff}main{max-width:900px;margin:auto;padding:22px}h1{font-size:26px;line-height:1.2;margin:8px 0 18px}h2{font-size:19px;margin:22px 0 10px}h3{font-size:17px;margin:14px 0 8px}p{margin:10px 0}ul,ol{padding-left:22px}li{margin:6px 0}.note{font-size:13px;color:#53616a}.callout{border-left:4px solid #405d73;background:#f2f5f7;padding:10px 14px}table{border-collapse:collapse;width:100%;margin:12px 0}caption{text-align:left;font-weight:bold;padding:0 0 8px}th,td{padding:9px 8px;text-align:left;vertical-align:top;border-bottom:1px solid #b8c3ca;overflow-wrap:anywhere}th{background:#edf2f5}td b{display:none}footer{border-top:1px solid #aeb9bf;margin-top:22px;padding-top:12px}pre{white-space:pre-wrap;overflow-wrap:anywhere;font:16px/1.5 ui-monospace,monospace;background:#f5f5f5;padding:12px}@media(max-width:560px){main{padding:16px}h1{font-size:23px}thead{display:none}table,tbody,tr,td{display:block;width:100%}caption{display:block}tr{border-bottom:1px solid #aeb9bf;padding:6px 0}td{border:0;padding:3px 0}td b{display:inline}}@media print{@page{size:letter;margin:.5in}main{padding:0}}.first{background:#f4f1f8;border-left:4px solid #635378;padding:12px}.reference{border-top:3px solid #635378;padding-top:10px}summary{padding:10px 0;cursor:pointer}summary:focus-visible{outline:3px solid #635378;outline-offset:3px}pre{font-size:14px}@media(min-width:561px){.cases th:last-child,.cases td:last-child{min-width:46px;white-space:nowrap}}</style></head><body><main><p class="note">Original unpublished teaching CLI - checked local commands, no hosted product</p><h1>clock-minutes - a first run you can check</h1><h2>Tutorial - convert one clock label</h2><div class="first"><p>Save the supplied source as clock-minutes.mjs in a separate local folder. Node24.11.0 checked; other versions unverified. No package installation.</p><pre>node clock-minutes.mjs 01:30</pre><p><strong>stdout:</strong> 90 minutes. <strong>stderr:</strong> empty. <strong>Exit:</strong>0.</p></div><h2>How-to - check supported boundary labels</h2><pre>node clock-minutes.mjs 00:00
# stdout: 0 minutes; exit0
node clock-minutes.mjs 23:59
# stdout: 1439 minutes; exit0</pre><p>Use these to check the accepted boundaries. They are clock-label offsets, not dated instants or elapsed travel times.</p><h2 class="reference">Reference - exact inputs and errors</h2><table><caption>One argument, two-digit hours and minutes</caption><thead><tr><th scope="col">Rule</th><th scope="col">Result</th></tr></thead><tbody><tr data-rule="format"><td><b>Rule: </b>Exactly one HH:MM; hours00-23, minutes00-59</td><td><b>Result: </b>Integer offset in minutes; stdout and exit0.</td></tr><tr data-rule="arguments"><td><b>Rule: </b>Missing or extra argument</td><td><b>Result: </b>Provide exactly one HH:MM clock label. stderr, exit1, stdout empty.</td></tr><tr data-rule="invalid"><td><b>Rule: </b>Malformed or out-of-range label</td><td><b>Result: </b>Use HH:MM with hours00-23 and minutes00-59. stderr, exit1, stdout empty.</td></tr></tbody></table><h2>Explanation - what the number means</h2><p data-calculation>Hours ×60 + minutes. 01:30: 1 ×60 +30 =90. 23:59: 23 ×60 +59 =1439. No date, time zone, daylight-saving conversion or interval crossing midnight is resolved.</p><details><summary>Read complete original clock-minutes.mjs source</summary><pre>const args = process.argv.slice(2);
const fail = message => { console.error(message); process.exit(1); };
if (args.length !== 1) fail('Provide exactly one HH:MM clock label.');
const match = /^(\d{2}):(\d{2})$/.exec(args[0]);
if (!match || Number(match[1]) > 23 || Number(match[2]) > 59) {
fail('Use HH:MM with hours00-23 and minutes00-59.');
}
console.log((Number(match[1]) * 60 + Number(match[2])) + ' minutes');
</pre></details><h2>Execution evidence</h2><table class="cases"><caption>Eight actual local Node24.11.0 checks</caption><thead><tr><th scope="col">Arguments</th><th scope="col">stdout / stderr</th><th scope="col">Exit</th></tr></thead><tbody><tr data-case="0"><td><b>Arguments: </b>01:30</td><td><b>stdout / stderr: </b>90 minutes / stderr empty</td><td><b>Exit: </b>0</td></tr><tr data-case="1"><td><b>Arguments: </b>00:00</td><td><b>stdout / stderr: </b>0 minutes / stderr empty</td><td><b>Exit: </b>0</td></tr><tr data-case="2"><td><b>Arguments: </b>23:59</td><td><b>stdout / stderr: </b>1439 minutes / stderr empty</td><td><b>Exit: </b>0</td></tr><tr data-case="3"><td><b>Arguments: </b>(none)</td><td><b>stdout / stderr: </b>stdout empty / Provide exactly one HH:MM clock label.</td><td><b>Exit: </b>1</td></tr><tr data-case="4"><td><b>Arguments: </b>01:30 02:00</td><td><b>stdout / stderr: </b>stdout empty / Provide exactly one HH:MM clock label.</td><td><b>Exit: </b>1</td></tr><tr data-case="5"><td><b>Arguments: </b>24:00</td><td><b>stdout / stderr: </b>stdout empty / Use HH:MM with hours00-23 and minutes00-59.</td><td><b>Exit: </b>1</td></tr><tr data-case="6"><td><b>Arguments: </b>01:60</td><td><b>stdout / stderr: </b>stdout empty / Use HH:MM with hours00-23 and minutes00-59.</td><td><b>Exit: </b>1</td></tr><tr data-case="7"><td><b>Arguments: </b>abc</td><td><b>stdout / stderr: </b>stdout empty / Use HH:MM with hours00-23 and minutes00-59.</td><td><b>Exit: </b>1</td></tr></tbody></table><h2>Project facts to confirm</h2><p>Maintainer, support route, license, supported-runtime policy and actual documentation location [TO CONFIRM]. No network, files, package scripts, compatibility guarantee or repository publication invented.</p><footer>Ask a teammate to run a successful and invalid command with the supplied source. Revise actual repository documentation after comparing results; this static reading aid neither commits nor publishes.</footer></main></body></html>