Last Updated: February 25, 2016
·
1.406K
· denizac

jsig - precise & concise JavaScript signature notation

Sure, JavaScript is a dynamically typed languages, but I've found having an explicit notation to be the fastest way to communicate to another developer how to use a module I've written.

I wrote up jsig - JavaScript signature notation - to formalize the notation we've been using in our codebase at work and in the documentation for my npm modules.

Here's what it looks like:

 // ({stderr: ReadStream, stdout: ReadStream }) => void
function log(stdio) {
  file = require('fs').createWriteStream('io.log')
  stdio.stdout.pipe(file)
  stdio.stderr.pipe(file)
}

jsig helps write clear, accurate function comments and documentation with fewer words and less ambiguity.

Have feedback? Please contribute and open an issue on the GitHub repo.

You can see jsig in action in the readme for minq