DEV Community

Hasibul Hasan (Anik)
Hasibul Hasan (Anik)

Posted on

Godoc like CLI tool for nodejs documentation.

Hello there,
Here is a tool for nodejs documentation. https://github.com/AnikHasibul/jsdoc

Image from https://www.conetix.com.au/blog/a-closer-look-at-go-and-nodejs

We all know that, how hard it is to find out methods and functions of a nodejs module.
And we also know how easy it is in Golang. It's as simple as go doc fmt

But as other devs I always try to dump (console.log) an object to know a bit about the object. And jsdoc does the same thing! ;)

So here is few examples of jsdoc:

Listing objects from console module.

$ jsdoc console
Console {
  log: [Function: bound consoleCall],
  debug: [Function: bound consoleCall],
  info: [Function: bound consoleCall],
  dirxml: [Function: bound consoleCall],
  warn: [Function: bound consoleCall],
  error: [Function: bound consoleCall],
  dir: [Function: bound consoleCall],
  time: [Function: bound consoleCall],
  timeEnd: [Function: bound consoleCall],
  timeLog: [Function: bound timeLog],
  trace: [Function: bound consoleCall],
  assert: [Function: bound consoleCall],
  clear: [Function: bound consoleCall],
  count: [Function: bound consoleCall],
  countReset: [Function: bound consoleCall],
  group: [Function: bound consoleCall],
  groupCollapsed: [Function: bound consoleCall],
  groupEnd: [Function: bound consoleCall],
  table: [Function: bound consoleCall],
  Console: [Function: Console],
  profile: [Function: profile],
  profileEnd: [Function: profileEnd],
  timeStamp: [Function: timeStamp],
  context: [Function: context],
  [Symbol(kBindStreamsEager)]: [Function: bound ],
  [Symbol(kBindStreamsLazy)]: [Function: bound ],
  [Symbol(kBindProperties)]: [Function: bound ],
  [Symbol(kWriteToConsole)]: [Function: bound ],
  [Symbol(kGetInspectOptions)]: [Function: bound ],
  [Symbol(kFormatForStdout)]: [Function: bound ],
  [Symbol(kFormatForStderr)]: [Function: bound ],
  [Symbol(counts)]: Map {},


  [Symbol(kGroupIndent)]: '' }
Enter fullscreen mode Exit fullscreen mode

Listing items from http package's METHODS array:

$ jsdoc http.METHODS
[ 'ACL',
  'BIND',
  'CHECKOUT',
  'CONNECT',
  'COPY',
  'DELETE',
  'GET',
  'HEAD',
  'LINK',
  'LOCK',
  'M-SEARCH',
  'MERGE',
  'MKACTIVITY',
  'MKCALENDAR',
  'MKCOL',
  'MOVE',
  'NOTIFY',
  'OPTIONS',
  'PATCH',
  'POST',
  'PROPFIND',
  'PROPPATCH',
  'PURGE',
  'PUT',
  'REBIND',
  'REPORT',
  'SEARCH',
  'SOURCE',
  'SUBSCRIBE',
  'TRACE',
  'UNBIND',
  'UNLINK',
  'UNLOCK',
  'UNSUBSCRIBE' ]
Enter fullscreen mode Exit fullscreen mode

I hope you got the concept about jsdoc tool.

You can download the tool for yourself and put a star on the repo at https://github.com/AnikHasibul/jsdoc

Thank you!

Top comments (0)