Quite often I fire up the node REPL and pull in some modules I've written to use on the command line. Unfortunately I often forget the exact way to call the various functions in those modules (there are a lot) and end up doing something like foo.dosomething.toString() to see the source code and recall the function signature.
In the interest of making code as "self-documenting" as possible, I wrote a small utility that uses dox to provide help for modules on the command line. It adds a help() function to a module's exported methods so you can get the dox / jsdoc comments for the function on the command line.
So now foo.dosomething.help() will return the description, parameters, examples and so on for the method based on the documentation in the comments.
It's still a bit of a work in progress, but it works nicely - provided you actually document your modules with jsdoc-style comments.
All the info is here: https://www.npmjs.org/package/doxli
Subscribe to:
Post Comments (Atom)
Productivity and Note-taking
I told a friend of mine that I wasn't really happy with the amount of time that gets taken up by Slack and "communication and sched...
-
Update : Here are slides for this talk at OttawaJS: " Node.JS Module Patterns Using Simple Examples ". Update 2 : More Node.JS M...
-
tldr; https://github.com/73rhodes/sideflow This extension provides goto, gotoIf and while loop functionality in Selenium IDE. Selenium ...
-
Other articles in this series: REST API Best Practices: A REST Cheat Sheet REST API Best Practices: HTTP and CRUD REST API Best Practice...
No comments:
Post a Comment