@morcxlla/clock
A simple digital clock synchronized to the second, easy to use in JavaScript, React, Vue, or Node.js.
Loading...
npm i @morcxlla/clock
import createClock from "@morcxlla/clock";
const [time, setTime] = useState("");
useEffect(() => {
const clock = createClock();
setTime(clock.getClock()); // set initial time
clock.nextTick(setTime); // update every second
}, []);