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 🙏

© 2025 – Pkg Stats / Ryan Hefner

logseq-smith

v0.1.0

Published

A toolkit for transforming and working with Logseq data

Readme

Logseq Smith

License: MIT

A toolkit for transforming and working with Logseq data. Currently includes a powerful converter from Logseq's format to standard Markdown, preserving structure, links, and assets.

Features

  • Converts Logseq's bullet-based format to standard Markdown
  • Preserves hierarchical structure and formatting
  • Transforms Logseq properties to YAML frontmatter
  • Handles page references, block references, and embeds
  • Processes and copies assets
  • Supports namespace hierarchy in output folder structure
  • Simple, intuitive command-line interface

Installation

Global Installation

npm install -g logseq-smith

Local Installation

npm install logseq-smith

Usage

Command Line

# Basic usage
logseq-smith --input /path/to/logseq/graph --output /path/to/output/directory

# Options
logseq-smith --input ~/Notes/my-graph --output ~/Exports/markdown --flat --no-assets

# Show help
logseq-smith --help

Command Alias

For quicker access, you may want to set up an alias:

# Add to your ~/.bashrc or ~/.zshrc
alias lgs="logseq-smith"

# Now you can use the shorter command
lgs --input ~/LogseqGraph --output ~/ExportedMarkdown

### Options

| Option | Description |
|--------|-------------|
| `-i, --input <directory>` | Logseq graph directory (required) |
| `-o, --output <directory>` | Output directory for converted files (required) |
| `-f, --flat` | Use flat structure (no namespace folders) |
| `--no-assets` | Skip copying assets |
| `--verbose` | Show detailed progress information |
| `-v, --version` | Show version information |

### API Usage

You can also use the tool programmatically:

```javascript
const { convertGraph } = require('logseq-smith');

async function convert() {
  const result = await convertGraph({
    inputDir: '/path/to/logseq/graph',
    outputDir: '/path/to/output',
    preserveHierarchy: true,
    copyAssets: true,
    progressCallback: (progress) => console.log(`${progress.stage}: ${progress.message}`),
  });
  
  console.log(`Converted ${result.pagesConverted} pages`);
}

convert();

How It Works

Logseq-to-Markdown processes your Logseq graph in these steps:

  1. Reading: Scans the Logseq graph structure and reads page files
  2. Parsing: Analyzes Logseq's bullet-based Markdown format
  3. Transforming: Converts to standard Markdown while preserving structure
  4. Processing Links: Updates internal links to work in the new format
  5. Asset Handling: Copies and updates references to images and other assets
  6. Output: Writes converted files to the output directory

Limitations

  • Complex Logseq queries are converted but won't be functional in standard Markdown
  • Some Logseq-specific features (like interactive diagrams) may not have exact equivalents
  • Task/todo states are converted to standard Markdown checkboxes

Development

Setup

git clone https://github.com/sidsarasvati/logseq-utils.git
cd logseq-utils
npm install

Testing

npm test

Building

npm run build

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.