npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@vandrite/plugin-api

v0.1.2

Published

Official API for developing Vandrite plugins

Readme

@vandrite/plugin-api

Official API for developing plugins for Vandrite, a modern note-taking application.

Installation

npm install @vandrite/plugin-api

Quick Start

import { Plugin, PluginManifest } from '@vandrite/plugin-api';

export default class MyPlugin extends Plugin {
  async onload() {
    console.log('Plugin loaded!');

    // Add a command
    this.addCommand({
      id: 'my-command',
      name: 'My Command',
      callback: () => {
        this.app.events.trigger('notice', 'Hello from my plugin!');
      },
    });
  }

  onunload() {
    console.log('Plugin unloaded!');
  }
}

Plugin Manifest

Create a manifest.json in your plugin folder:

{
  "id": "my-plugin",
  "name": "My Plugin",
  "version": "1.0.0",
  "description": "A sample plugin",
  "author": "Your Name",
  "minAppVersion": "0.1.0"
}

Available APIs

app.commands

Register and execute commands.

this.addCommand({
  id: 'my-plugin:do-something',
  name: 'Do Something',
  hotkeys: [{ modifiers: ['Mod'], key: 'p' }],
  callback: () => {
    /* ... */
  },
});

app.events

Subscribe to application events.

const ref = this.app.events.on('file-open', (file) => {
  console.log('File opened:', file.path);
});
this.registerEvent(ref);

app.vault

Access files in the user's vault.

// Read a file
const content = await this.app.vault.read('path/to/file.md');

// Write a file
await this.app.vault.create('new-file.md', 'Hello World');

// List files
const files = await this.app.vault.getFiles();

app.modals

Show dialogs and prompts.

// Alert
await this.app.modals.alert('Success!', 'File saved');

// Confirm
const confirmed = await this.app.modals.confirm({
  title: 'Delete?',
  message: 'This cannot be undone',
  isDangerous: true,
});

// Prompt
const name = await this.app.modals.prompt({
  title: 'Enter Name',
  placeholder: 'Type here...',
});

// Select
const choice = await this.app.modals.select({
  title: 'Choose Template',
  options: [
    { value: 'blank', label: 'Blank Note' },
    { value: 'daily', label: 'Daily Note' },
  ],
});

app.hotkeys

Register keyboard shortcuts.

this.app.hotkeys.register({
  id: 'my-plugin:search',
  keys: 'Mod+Shift+F', // Cmd on Mac, Ctrl on Windows
  callback: () => openSearch(),
});

app.editor

Interact with the text editor.

// Insert text
this.app.editor.insertText('Hello');

// Get selection
const text = this.app.editor.getSelectedText();

// Formatting
this.app.editor.toggleBold();
this.app.editor.setHeading(2);

// Content
const markdown = this.app.editor.getContent();
const words = this.app.editor.getWordCount();

app.theme

Access and modify the current theme.

const theme = this.app.theme.getTheme();
this.app.theme.setTheme('dark');

Plugin Settings

interface MySettings {
  showGreeting: boolean;
  greetingText: string;
}

const DEFAULT_SETTINGS: MySettings = {
  showGreeting: true,
  greetingText: 'Hello!',
};

export default class MyPlugin extends Plugin {
  settings: MySettings;

  async onload() {
    this.settings = Object.assign({}, DEFAULT_SETTINGS, await this.loadData());
  }

  async saveSettings() {
    await this.saveData(this.settings);
  }
}

Settings Tab

import { PluginSettingTab, App } from '@vandrite/plugin-api';

class MySettingTab extends PluginSettingTab {
  plugin: MyPlugin;

  constructor(app: App, plugin: MyPlugin) {
    super(app, plugin);
    this.plugin = plugin;
  }

  display(): void {
    const container = this.containerEl;
    container.empty();
    container.createEl('h2', { text: 'My Plugin Settings' });
    // Add your settings UI here
  }
}

Building Your Plugin

  1. Compile your TypeScript to JavaScript
  2. Create a folder with manifest.json and main.js
  3. ZIP the folder for distribution

License

MIT