-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Core module constants
is not documented
#8533
Comments
Its for node internal use, why would you like it to be documented? |
@sam-github it isn't really for only internal use, we have lots of places where the constants could be supplied. |
I can see that, but actually exposing constants as API is a bit horrid, IMO. I'd love to see a process.signals containing the And even though you can supply numeric signals, instead of a string, why would you? What APIs are there in node that would be easier for the user to use if they had this? I confess to using the constants to validate whether a user-provided string is actually a valid signal name, but that's about it. |
I have seen it used in @isaacs's graceful-fs and personally I like to use it for I agree that it may be too low level to expose everything and it would be better to define the most useful constants directly in the appropriate modules. Nevertheless, because core modules take precedence over those installed in |
If all the modules were documented, I think we'd have a lot of confusing questions and issues regarding modules people shouldn't have touched in the first place - there are certainly modules for standard use and definitely not for standard use. Sometimes, circumstances may render the usage of such an internal module, but I think that you should only (maybe) be using that module in the first place if you know to browse the code in |
I think documenting reserved module names is a good thing, not argument there. In graceful-fs, and most other uses, typeing out Except, for file modes, you are right, it does start to make sense, you often have to I suggest that all the mode constants be made properties on the |
@sam-github it makes sense. @brendanashworth if a module is internal and should not be exposed maybe its name should start with an underscore (e.g. |
About |
It'd be a breaking change to rename all undocumented modules to start with an underscore, but that seems like the most (if not only) logical choice here. Maybe it would be an option to document in-code instead of on the website ( |
@joyent/node-coreteam ... I doubt this is something we'd ever land here. Recommend deferring to converged. |
+1 |
I think there might be some portability issues that are lurking in the constants module. I have some old notes on the subject: Libuv maps system errors to UV_* error codes. These can have different values depending on the platform (uv-errno.h). So I am -1 on documenting this module before reviewing these issues. |
Ok, going to close this issue then. We can revisit this later after convergence. |
Just for Info. Public documentation:
According to this public API documentation, I now use There is no support for 'secureOption' in new API documentation, and no mention about these constants though. |
No description provided.
The text was updated successfully, but these errors were encountered: