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

markdown-note-orm

v1.2.0

Published

The lib is designed as a library for Obsidian Plugin to manipulate markdown files

Readme

Markdown Note ORM

markdown-note-orm is a specialized library designed primarily for Obsidian Plugins to interact with and manipulate Markdown files programmatically. It treats Markdown files as structured objects, providing an ORM-like interface to manage YAML frontmatter and document sections.

Features

  • Environment Agnostic: Works in both Node.js (via NodeFileAdapter) and Obsidian (via ObsidianVaultAdapter).
  • Structured Frontmatter: Manage YAML metadata with type-safe properties.
  • Section-Based Content Management: Automatically parses Markdown by headers, allowing you to append or modify specific sections.
  • Serialization: Easily convert structured objects back into standard Markdown strings.

Installation

npm install markdown-note-orm

Quick Start

1. Initialize an Adapter

Choose the appropriate adapter for your environment.

For Obsidian Plugins:

import { ObsidianVaultAdapter } from 'markdown-note-orm';
const adapter = new ObsidianVaultAdapter(this.app); // 'this.app' is the Obsidian App instance

For Node.js scripts:

import { NodeFileAdapter } from 'markdown-note-orm';
const adapter = new NodeFileAdapter("./my-vault");

2. Loading and Manipulating a Note

The NoteModel class is the primary entry point for note manipulation.

import { NoteModel } from 'markdown-note-orm';

// Load a note
const note = await NoteModel.load(adapter, "folder/note.md");

// Access the title (extracted from filename)
console.log(note.title); // "note"

// Manage Frontmatter
note.properties.set("status", "complete");
note.properties.addTag("research");

// Manage Content Sections
note.content.appendToSection("Summary", "This is a new line of text.");

// Serialize and Save
const finalContent = note.serialize();
await adapter.write(note.path, finalContent);

Class Diagram

Core Components

FrontmatterManager

Handles the YAML block at the top of the file.

  • get(key): Retrieve a metadata value.
  • set(key, value): Update or add a value.
  • addTag(tag): Utility to handle Obsidian-style tags.

ContentManager

Parses the body of the Markdown file into distinct sections based on headers.

  • addSection(title, level, content): Add a new header and its text.
  • getSection(title): Retrieve content from a specific header.
  • appendToSection(title, text): Appends text to an existing header or creates a new one.

Adapters

The library uses the IVaultAdapter interface to remain compatible across platforms.

  • NodeFileAdapter: Uses fs/promises for local file system access.
  • ObsidianVaultAdapter: Uses Obsidian's internal vault and metadataCache for optimal performance.

License

MIT