avancement planning

This commit is contained in:
2026-05-26 11:58:39 +02:00
parent 619a2b240a
commit 150b97cd2e
4892 changed files with 99214 additions and 429382 deletions
+4 -4
View File
@@ -76,13 +76,13 @@ const { log, output, input, time } = require('proc-log')
#### input
* `input.start(fn?)` calls `process.emit('input', 'start')`
* `input.start(...args)` calls `process.emit('input', 'start', ...args)`
Used to tell the consumer that the terminal is going to begin reading user input. Returns a function that will call `input.end()` for convenience.
Used to tell the consumer that the terminal is going to begin reading user input. Returns a function that will call `input.end(...args)` for convenience.
This also takes an optional callback which will run `input.end()` on its completion. If the callback returns a `Promise` then `input.end()` will be run during `finally()`.
If the first argument is a function, it will be used as a callback which runs `input.end()` on its completion. If the callback returns a `Promise` then `input.end(...args)` will be run during `finally()`.
* `input.end()` calls `process.emit('input', 'end')`
* `input.end(...args)` calls `process.emit('input', 'end', ...args)`
Used to tell the consumer that the terminal has stopped reading user input.
+10 -5
View File
@@ -122,10 +122,15 @@ module.exports = {
end: 'end',
read: 'read',
},
start: function (fn) {
process.emit('input', 'start')
start: function (...args) {
// Support callback for backwards compatibility and pass additional args to event
let fn
if (typeof args[0] === 'function') {
fn = args.shift()
}
process.emit('input', 'start', ...args)
function end () {
return process.emit('input', 'end')
return process.emit('input', 'end', ...args)
}
if (typeof fn === 'function') {
const res = fn()
@@ -137,8 +142,8 @@ module.exports = {
}
return end
},
end: function () {
return process.emit('input', 'end')
end: function (...args) {
return process.emit('input', 'end', ...args)
},
read: function (...args) {
let resolve, reject
+4 -4
View File
@@ -1,6 +1,6 @@
{
"name": "proc-log",
"version": "6.0.0",
"version": "6.1.0",
"files": [
"bin/",
"lib/"
@@ -25,8 +25,8 @@
"eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\""
},
"devDependencies": {
"@npmcli/eslint-config": "^5.0.0",
"@npmcli/template-oss": "4.27.1",
"@npmcli/eslint-config": "^6.0.0",
"@npmcli/template-oss": "4.28.1",
"tap": "^16.0.1"
},
"engines": {
@@ -34,7 +34,7 @@
},
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"version": "4.27.1",
"version": "4.28.1",
"publish": true
},
"tap": {