(d = new Date())
| 19 | export const datetimeUTC = (d = new Date()) => d.toISOString().replace('T', ' ').replace('Z', ''); |
| 20 | // same as datetimeUTC() but for local timezone, e.g., UTC + 2h for the above in DE |
| 21 | export const datetime = (d = new Date()) => datetimeUTC(new Date(d.getTime() - d.getTimezoneOffset() * 60000)); |
| 22 | export const filenamify = s => s.replaceAll(':', '.').replace(/[^a-z0-9 _\-.]/gi, '_'); // alternative: https://www.npmjs.com/package/filenamify - On Unix-like systems, / is reserved. On Windows, <>:"/\|?* along with trailing periods are reserved. |
| 23 | |
| 24 | export const handleSIGINT = (context = null) => process.on('SIGINT', async () => { // e.g. when killed by Ctrl-C |
no test coverage detected