No description
Find a file
2025-07-30 09:43:55 -04:00
.editorconfig Initial commit 2025-06-19 21:06:58 -04:00
.eslintignore Initial commit 2025-06-19 21:06:58 -04:00
.eslintrc Initial commit 2025-06-19 21:06:58 -04:00
.gitignore Initial commit 2025-06-19 21:06:58 -04:00
.npmrc Initial commit 2025-06-19 21:06:58 -04:00
esbuild.config.mjs Initial commit 2025-06-19 21:06:58 -04:00
LICENSE Paperwork 2025-06-19 22:21:24 -04:00
main.ts Fix: use cachedRead instead of read for performance 2025-07-23 00:09:36 -04:00
manifest.json Correct minimum app version 2025-07-30 09:43:55 -04:00
package-lock.json Fix: rollup builds 2025-06-19 22:26:16 -04:00
package.json Simplify/update versioning 2025-07-29 18:56:00 -04:00
README.md Correct typo in README 2025-06-19 22:34:11 -04:00
rollup.config.js Fix: rollup builds 2025-06-19 22:26:16 -04:00
tsconfig.json Fix: rollup builds 2025-06-19 22:26:16 -04:00
version-bump.mjs Initial commit 2025-06-19 21:06:58 -04:00

Vault Stats Plugin for Obsidian

A simple Obsidian plugin that exposes two handy global functions for vault statistics, which you can call from DataviewJS or other scripts:

  • showStats(): Returns markdown summary of vault note count, word count, links, and tags.
  • showLastModifiedNotes(numItems = 10, excludeFolder = "Templates"): Returns markdown list of the most recently modified notes, excluding an optional folder.

Installation

You can grab it from the Obsidian app, Community Plugins section.

  1. Clone or download this repo.

  2. Build the plugin with npm install and npm run build.

  3. Copy the resulting main.js, manifest.json, and optionally styles.css to your vault plugin folder: /.obsidian/plugins/vault-stats/

  4. Enable the plugin in Obsidian's Community Plugins settings.

Usage

Inside any note, create a DataviewJS block like this:

// Show general vault stats
let s = await window.showStats();
dv.paragraph(s);

// Show last modified notes (default 10, excluding "Templates" folder)
let recent = await window.showLastModifiedNotes(10, "Templates");
dv.paragraph("### 🕒 Last Modified Notes:\n\n" + recent);

You can customize numItems and excludeFolder arguments for showLastModifiedNotes.

Development

The main plugin code is in main.ts.

Build with npm run build.

For development, use npm run dev to watch and rebuild on changes.

License

MIT License — feel free to use and modify.