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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@endeavorance/hammerstone

v0.1.3

Published

Load and manipulate Obsidian vault data

Downloads

2

Readme

Hammerstone

Load and manipulate Obsidian vault data

API

new Vault(vaultRootPath [, options])

Create a new Vault object. Searches for markdown files in the given directory, loads, and parses frontmatter for each document.

Options

| Option | Description | Default | | ---------------- | ---------------------------------------------------------- | ------- | | ignorePatterns | An optional array of globs to ignore when discovering docs | [] |

vault.process(fn)

Process all documents in the vault. Each document is passed to the provided function.

Returns a reference to the vault to allow for chaining of document processing flows.

vault.scope(fn)

Returns a VaultView containing only the documents which the provided function returns a truthy value for (similar to Array.filter()).

A VaultView has the .process() function just as a Vault does. You can also call .unscope() on a VaultView which returns a reference to the original vault, allowing you to chain processing flows which dive in and out of different filtered scopes.

vault.write()

Write all vault documents back to disk.

vault.documents

(Property) An array of all documents in this vault

vault.index

(Property) A map of document slugs to the document itself

new MarkdownDocument(filePath, vault)

A MarkdownDocument object represents a single document in the Vault. Generally, the Vault itself handles creating these objects, which can be accessed via the .documents or .index properties on the Vault.

markdownDocument.setMarkdown(markdownContent)

Set the markdown content of this document (separately from the YAML frontmatter)

markdownDocument.setFrontmatter(frontmatterShape)

Set the frontmatter content of this document (separately from the markdown)

markdownDocument.setContent(newContent)

Set the full text content of this document (raw YAML frontmatter and markdown)

markdownDocument.hasTag(tag)

Check if this document is tagged with the given tag

markdownDocument.hasTaxonomy(dirs)

Check if this document exists in the given directory structure as an array of directory names

markdownDocument.revert()

Revert any changes to this document back to its original loaded content

markdownDocument.write()

Write this file back to disk

markdownDocument.markdown

(Property) The markdown contents of this document

markdownDocument.frontmatter

(Property) The frontmatter contents of this document

markdownDocument.content

(Property) The full content of this document