Get API information from a module
Install get-api
using npm:
npm install --save get-api
var getApi = require('get-api');
var mod = require('path-to-a-module');
getApi(mod);
/**
* {
* methods: [...],
* properties: [...]
* }
*/
See the tests for examples.
Name | Type | Description |
---|---|---|
mod | Mixed |
The module to get API for |
opts | Object |
Options |
Returns: Object
, see the tests for examples.
Type: String
Default: "__MAIN_EXPORT__"
If provided it's used as a name fallback in case there is a main exported function without a name, i.e:
module.exports = function () {};
MIT