README
module-async-mapper
Discover and specify module methods' continuation schemes (callbacks vs promises vs generator functions, etc)
mapper.map(module[, hints, options])
Traverses the module and returns a JSONPath style map of the given module's methods, along with a heuristic best guess at their continuation scheme, accepting hints to inform guesses.
var mapper = require('module-async-mapper');
var fs = require('fs');
var map = mapper.map(fs);
// {
// '$.readFile': 'standard',
// '$.readFileSync': 'sync',
// '$.writeFile': 'standard',
// '$.writeFileSync': 'sync',
// '$.exists': 'simple',
// '$.existsSync': 'sync',
// ...
// }
Hints are in the form of an object with JSONPath keys pointing to continuation scheme identifiers, optionally preceded by a +
to force that option to take effect.
And another example: The mkdirp
module exports a function that accepts a standard node callback, but that happens to be difficult to ascertain programmatically so we provide a hint.
var mapper = require('module-async-map');
var mkdirp = require('mkdirp');
var map = mapper.map(mkdirp, { '