Download web/node_modules/execa/lib/verbose.js from amitesh11/pose: direct link, hf CLI and curl.
- Browser
- Download file 575 Bytes
-
https://huggingface.co/spaces/amitesh11/pose/resolve/main/web/node_modules/execa/lib/verbose.js
- Command line
-
hf download hf://spaces/amitesh11/pose/web/node_modules/execa/lib/verbose.js
-
curl -L -o verbose.js https://huggingface.co/spaces/amitesh11/pose/resolve/main/web/node_modules/execa/lib/verbose.js
575 Bytes
| import {debuglog} from 'node:util'; | |
| import process from 'node:process'; | |
| export const verboseDefault = debuglog('execa').enabled; | |
| const padField = (field, padding) => String(field).padStart(padding, '0'); | |
| const getTimestamp = () => { | |
| const date = new Date(); | |
| return `${padField(date.getHours(), 2)}:${padField(date.getMinutes(), 2)}:${padField(date.getSeconds(), 2)}.${padField(date.getMilliseconds(), 3)}`; | |
| }; | |
| export const logCommand = (escapedCommand, {verbose}) => { | |
| if (!verbose) { | |
| return; | |
| } | |
| process.stderr.write(`[${getTimestamp()}] ${escapedCommand}\n`); | |
| }; | |