1.0.1 • Published 9 years ago

get-api v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

get-api

Build status NPM version js-xo-style

Get API information from a module

Installation

Install get-api using npm:

npm install --save get-api

Usage

Module usage

var getApi = require('get-api');

var mod = require('path-to-a-module');

getApi(mod);
/**
 * {
 *   methods: [...],
 *   properties: [...]
 * }
 */

See the tests for examples.

API

getApi(mod [, opts])

NameTypeDescription
modMixedThe module to get API for
optsObjectOptions

Returns: Object, see the tests for examples.

options.main

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 () {};

License

MIT