npm install
npm run test
npm run build
npm run deploy
- nodejs (>= v18.10.0)
- npm (>= 8.19.2)
Install the required modules:
npm install
Run tests using the test
script:
npm run test
Build main.js
by running the build
script:
npm run build
Install the plugin into a vault by running the deploy
script. This script will copy the plugin into the directory specified in the PLUGIN_DIR
environment variable. PLUGIN_DIR
is expected to be set to the absolute path of the directory to copy the plugin into. This directory will be created if it doesn't already exist. PLUGIN_DIR
defaults to .sandbox/.obsidian/plugins/vault-statistics-plugin
. See the [[Sandbox Vault]] section below for more information.
To use the default sandbox vault:
npm run deploy
Alternatively you can specify a PLUGIN_DIR
to use for the deploy
script:
PLUGIN_DIR=... npm run deploy
or
export PLUGIN_DIR=...
npm run deploy
After installing the plugin, toggle the plugin on and off in settings or reload your vault to test changes.
The watch
script will watch for changes to source files. When changes are detected the test
, build
, and deploy
scripts are run.
PLUGIN_DIR=... npm run watch
The .sandbox
directory in this repository is a bare-bones vault intended to be used as a sandbox for interactive testing.