Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/voodoocreation/md-stats

A tool to report on statistics for Markdown file content within a folder (recursively).
https://github.com/voodoocreation/md-stats

cli command command-line count docs documentation markdown node report script scripts statistics stats word word-count wordcount

Last synced: 18 days ago
JSON representation

A tool to report on statistics for Markdown file content within a folder (recursively).

Awesome Lists containing this project

README

        

Markdown Stats
==============

A simple tool to report on statistics of Markdown file content within the given directory (recursively).

Useful for reporting how much documentation exists within a project.

Available stats are:
- Markdown file count
- character count
- word count

Usage
-----

### CLI
If the directory is omitted, it will run for the current directory.

If the `--verbose` flag is present, it will also display stats on a per-file basis.

#### Example
```shell script
npx md-stats ./path/to/files --verbose
```

### Node.js
The exported function can also be used in a Node.js environment, which will return the raw data.

#### Example
```javascript
const getMarkdownStats = require("md-stats");

const stats = await getMarkdownStats("./path/to/files");
```

The data returned is in the following format:
```
{
characters: number,
words: number,
files: [
{
name: string,
characters: number,
words: number
}
]
}
```