Efficient Word Count

by Blue Heron
5
4
3
2
1
Score: 51/100

Description

The Efficient Word Count plugin keeps track of word counts across your entire vault without slowing you down. It builds a cache of every Markdown file's count, listens for changes like edits, renames, or deletions, and updates instantly, so the data is always fresh. That cache is stored on disk, which means even big vaults start up quickly with accurate totals already ready. You can fine-tune which folders get skipped - like Templates or trash - and even tap into the global API to pull counts into DataviewJS or your own scripts.

Reviews

No reviews yet.

Stats

1
stars
418
downloads
1
forks
274
days
276
days
316
days
0
total PRs
0
open PRs
0
closed PRs
0
merged PRs
0
total issues
0
open issues
0
closed issues
0
commits

Latest Version

10 months ago

Changelog

manifest.json The first release of the plugin!

  • Exposes an object window.wordCountCache with a couple of methods, notably .total(), to get the total number of words across all notes.
  • Caches the word count in memory and on disk, and efficiently updates it as notes are updated
  • Loads quite fast, even with lots of notes and changes
  • Allows customization (exclusion of files and folders) via settings

It loads quite fast. With 17k words spanning 81 notes, the loading time is averages around 320ms (without file caching, around 591ms) on a decent development machine.

README file from

Github

Efficient Word Count — Obsidian Plugin

This plugin efficiently calculates and caches the word counts of all Markdown files in your vault, excluding configurable folders like Templates. It updates in real-time as files change, and caches results to disk to speed up startup and vault-wide statistics.

Features

  • Automatically builds a cache of word counts for all Markdown files.
  • Excludes folders you specify (default: Templates, .trash).
  • Listens to file create/modify/delete/rename events to update cache incrementally.
  • Persists cache data on disk for fast startup.
  • Exposes a global API (window.wordCountCache) with:
    • get(path) — word count for a specific file path
    • total() — total word count across all cached files

Installation

Available via the Community Plugins browser. If you want to install it manually:

  1. Clone or download this repository.
  2. Copy the plugin folder into your Obsidian vault’s .obsidian/plugins/efficient-wordcount/.
  3. Enable the plugin via Settings > Community Plugins.
  4. Wait a few seconds on vault load for the cache to build.

Usage

You can access the word counts in your DataviewJS scripts or custom scripts via the global object:


// Get total word count in vault
const total = window.wordCountCache.total();

// Get word count for a specific file path
const count = window.wordCountCache.get("Folder/Note.md");

Exclusions

You can configure excluded files or folders via the plugin settings. For files, the .md extension is optional.

Development

The plugin is written in JavaScript. If you prefer TypeScript, you're welcome to convert it over and open a PR.

Reload plugin in Obsidian after rebuilding via CTRL + P => Reload ....

License

MIT License. Feel free to contribute!

Similar Plugins

info
• Similar plugins are suggested based on the common tags between the plugins.
File Info Panel
4 years ago by CattailNu
This plugin for Obsidian creates a small File Info view that displays the active file's date created, date modified, file size, and links to open the file in its native application and to open the file's folder.
Novel Word Count
4 years ago by Isaac Lyman
Obsidian plugin. Displays a word count or other statistic for each file, folder and vault in the File Explorer pane.
Writing Goals
3 years ago by James Lynch
Set yourself dynamic writing goals for notes and folders to help you hit your long form writing targets with Obsidian.
Target Word Count
2 years ago by TwoFive Labs
Target Word Count Plugin for Obsidian
Daily Statistics
2 years ago by yefengr
obsidian daily statistics
Better Word Count
5 years ago by Luke Leppan
Counts the words of selected text in the editor.
Daily Stats
5 years ago by Dhruvik Parikh
Plugin to view your daily word count across all notes in your Obsidian.md vault.
Beeminder Word Count
5 years ago by Yuta Miyama
Beeminder integration with Obsidian, so that your word count in Obsidian contributes to your writing goals.
Keep the Rhythm
a year ago by Ezben
An Obsidian plugin to track your daily word count through a heatmap.
YourPulse - Your Writing Activity Visualised
a year ago by Jiri Sifalda
YourPulse.cc - Obsidian.md plugin that turns your vault into a reflection of your creativity, and put your writing on steroids 💪
Wordflow Tracker
a year ago by LeCheenaX
Track the changes and stats of your edited note files automatically in Obsidian. Record the modified notes and statistics to your daily note with various customizations!
Custom Selected Word Count
a year ago by banisterious
Custom Selected Word Count for Obsidian
CJK Count
10 months ago by Louie Kurenai
Vault Stats
9 months ago by Blue Heron
A plugin with some simple statistics.
WPM Reading Time - How Long to Read This Text
21 days ago by Santi Younger
Calculate reading time estimates for selected text using your own reading speed in Words Per Minute.