# api-toc

> Pass a dirname, get a markdown-formatted Table of Contents for your API.

Latest version **0.3.2** (published 2015-08-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install api-toc
pnpm add api-toc
yarn add api-toc
bun add api-toc
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.2 |
| Published | 2015-08-01 |
| First published | 2015-03-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 5 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Jon Schlinkert |
| Maintainers | jonschlinkert |

## Links

- npm: https://www.npmjs.com/package/api-toc
- Repository: https://github.com/jonschlinkert/api-toc
- Issues: https://github.com/jonschlinkert/api-toc/issues
- npm.io page: https://npm.io/package/api-toc

## Dependencies (5)

- [relative](https://npm.io/package/relative.md) ^3.0.1
- [mixin-deep](https://npm.io/package/mixin-deep.md) ^1.1.1
- [code-context](https://npm.io/package/code-context.md) ^0.5.2
- [filter-object](https://npm.io/package/filter-object.md) ^2.0.0
- [markdown-utils](https://npm.io/package/markdown-utils.md) ^0.7.0

## Recent versions

- 0.3.2 (latest) — 2015-08-01
- 0.3.1 — 2015-04-19
- 0.3.0 — 2015-04-19
- 0.2.0 — 2015-03-11
- 0.1.2 — 2015-03-11
- 0.1.1 — 2015-03-11
- 0.1.0 — 2015-03-11

## README

# api-toc [![NPM version](https://badge.fury.io/js/api-toc.svg)](http://badge.fury.io/js/api-toc)  [![Build Status](https://travis-ci.org/jonschlinkert/api-toc.svg)](https://travis-ci.org/jonschlinkert/api-toc)

> Pass a dirname, get a markdown-formatted Table of Contents for your API.

Currently this is pretty opinionated, but I may add a reduce or filter function to allow customizing the output. PR or suggestions welcome.

Install with [npm](https://www.npmjs.com/)

```sh
$ npm i api-toc --save
```

## Usage

```js
var toc = require('api-toc');
```

**Example**

Using the pseudo-code in `fixtures/`:

```js
toc('fixtures/');
```

Results in:

* **[config](fixtures/config.js)**

  - [.disable](fixtures/config.js#L10)
  - [.enable](fixtures/config.js#L6)
  - [.option](fixtures/config.js#L2)
* **[storage](fixtures/storage.js)**

  - [.extend](fixtures/storage.js#L10)
  - [.get](fixtures/storage.js#L2)
  - [.set](fixtures/storage.js#L6)
* **[utils](fixtures/utils.js)**

  - [.bar](fixtures/utils.js#L6)
  - [.baz](fixtures/utils.js#L10)
  - [.foo](fixtures/utils.js#L2)

The generated markdown looks like this:

```markdown
+ **[config](fixtures/config.js)**
  - [.disable](fixtures/config.js#L10)
  - [.enable](fixtures/config.js#L6)
  - [.option](fixtures/config.js#L2)
+ **[storage](fixtures/storage.js)**
  - [.extend](fixtures/storage.js#L10)
  - [.get](fixtures/storage.js#L2)
  - [.set](fixtures/storage.js#L6)
+ **[utils](fixtures/utils.js)**
  - [.bar](fixtures/utils.js#L6)
  - [.baz](fixtures/utils.js#L10)
  - [.foo](fixtures/utils.js#L2)
```

## Related projects

* [helper-apidocs](https://github.com/jonschlinkert/helper-apidocs): Template helper for automatically generating API docs from code comments. The sync version works with… [more](https://github.com/jonschlinkert/helper-apidocs)
* [markdown-toc](https://github.com/jonschlinkert/markdown-toc): Generate a markdown TOC (table of contents) with Remarkable.

## Running tests

Install dev dependencies:

```sh
$ npm i -d && npm test
```

## Contributing

Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/api-toc/issues/new)

## Author

**Jon Schlinkert**

+ [github/jonschlinkert](https://github.com/jonschlinkert)
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)

## License

Copyright © 2015 Jon Schlinkert
Released under the MIT license.

***

_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on August 01, 2015._

---
_Source: https://npm.io/package/api-toc · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
