You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import{once}from"node:events";importSonicBoomfrom"sonic-boom";conststartingPath="1.log";constnewPath="2.log";constboom=newSonicBoom({dest: startingPath,sync: false,append: true});awaitonce(boom,"ready");console.log("file:",boom.file);// 1.logboom.write("expect f1\n");boom.once("write",()=>{console.log("_writing:",boom._writing);// trueboom.reopen(newPath);});awaitonce(boom,"ready");// emitted on reopenconsole.log("file:",boom.file);//! 1.log, expected 2.logboom.write("expect f2\n");//! written into 1.log, expected into 2.log
According to the docs I can pass a new file path for
reopen
to continue to write into new file.However, if I call
reopen
during async write it ignores new file path (https://github.com/pinojs/sonic-boom/blob/v3.2.0/index.js#L304-L308)Code to reproduce
workaround
The text was updated successfully, but these errors were encountered: