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
{{ message }}
Repository navigation
fs: promises have undocumented write(string,…) method #20406
Without looking into it further: as far as I know the promises API should be identical to the non-promise one besides returning promises. So it sounds like a documentation issue.
@BridgeAR ... To be certain the promise certain is not identical. There are intended differences... Such as the use of the FileHandle object rather than numeric fd.
That does not sound intuitive to me at all. I would have expected it is fine to switch to promises 1-to-1. Can you outline the specific differences / where there a lot of these?
Activity
ChALkeR commentedon Apr 29, 2018
Not sure if this is a documentation issue. Should we keep that API in such form?
BridgeAR commentedon Apr 29, 2018
Without looking into it further: as far as I know the promises API should be identical to the non-promise one besides returning promises. So it sounds like a documentation issue.
vsemozhetbyt commentedon Apr 29, 2018
Refs: #18297 (comment) and next comment:
so cc @jasnell
ChALkeR commentedon Apr 29, 2018
It's undocumented, but present and partially broken — see #20407.
ChALkeR commentedon Apr 30, 2018
Note that according to coverage report, that variant is called once, which means that there is a test that depends on it being present.
jasnell commentedon Apr 30, 2018
Doc omission. The variant should be doc'd.
jasnell commentedon Apr 30, 2018
It was a to-do that I never went back to. Although if I recall correctly there may need to be some reconcilation still with the non-promise version
jasnell commentedon Apr 30, 2018
@BridgeAR ... To be certain the promise certain is not identical. There are intended differences... Such as the use of the FileHandle object rather than numeric fd.
BridgeAR commentedon Apr 30, 2018
That does not sound intuitive to me at all. I would have expected it is fine to switch to promises 1-to-1. Can you outline the specific differences / where there a lot of these?
ChALkeR commentedon May 8, 2018
@BridgeAR The ones I noticed:
fs.constants,fs.*_OK),fs.Stats,fs.WriteStream, etc.),close,*Stream,*watch*,*Sync,exists. fs: drop duplicate API in promises mode #20559 should remove even more.Example:
BridgeAR commentedon May 8, 2018
@ChALkeR thanks for pointing these things out.
6 remaining items
darahayes commentedon Oct 2, 2018
@ChALkeR @jasnell Hey folks, I just submitted a docs PR for this issue. I hope it helps in some way. I've raised some questions in there. Cheers!
doc: add filehandle.write(string[, position[, encoding]])
doc: add filehandle.write(string[, position[, encoding]])
doc: add filehandle.write(string[, position[, encoding]])
doc: add filehandle.write(string[, position[, encoding]])
doc: add filehandle.write(string[, position[, encoding]])
doc: add filehandle.write(string[, position[, encoding]])