node.js - JavaScript documentation rules? Need a way to specify the expected structure of an input object -
i find myself using lot of functions similar following in nodejs:
socket.on('view:create', function (data) { //data = { structure of data object here } .... })
i adding comment remember data object.
is there way specify structure of object receiving input, when inside function write data.key
recognises key valid?
i use commenting style advised google closure.
it similar style of different languages, helps autocompletion in modern ides, , jsdoc generating documentation easy
Comments
Post a Comment