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

@jfconley/confluence-downloader

v0.0.1

Published

Downloads Confluence spaces and converts to markdown

Downloads

5

Readme

Confluence Downloader

A powerful CLI tool to download and sync Confluence spaces to local markdown files, maintaining the original page hierarchy and metadata.

Features

  • 🚀 Interactive CLI for easy space management
  • 📁 Maintains Confluence page hierarchy in local directory structure
  • 🔄 Incremental sync with last update tracking
  • 🏷️ Preserves page metadata, labels, and comments
  • 📝 Converts Confluence content to clean markdown
  • 🌳 Directory-based structure for pages with children
  • ⚡ Concurrent processing for faster downloads
  • 🔍 Fuzzy search for space selection
  • 🎨 Beautiful progress bars and status updates

Installation

# Using npm
npm install -g @jfconley/confluence-downloader

# Using pnpm
pnpm add -g @jfconley/confluence-downloader

# Using yarn
yarn global add @jfconley/confluence-downloader

Quick Start

  1. Create a .env file with your Confluence credentials:
CONFLUENCE_BASE=https://your-domain.atlassian.net
CONFLUENCE_TOKEN=your-api-token
[email protected]
CONFLUENCE_CONFIG=./confluence.json
  1. Initialize the library:
confluence-downloader init
  1. Start the interactive mode:
confluence-downloader interactive

Usage

Interactive Mode

The easiest way to use the tool is through interactive mode:

confluence-downloader interactive -t <token> -b <base-url> -c <config-path>

This provides a menu-driven interface with the following options:

  • List spaces
  • Add space
  • Remove space
  • Sync space
  • Sync all spaces
  • Show configuration
  • Exit

Command Line Interface

# Initialize a new library
confluence-downloader init --baseUrl <url> --apiToken <token>

# Add a space
confluence-downloader add-space --spaceKey <key> [--localPath <path>]

# Remove a space
confluence-downloader remove-space --spaceKey <key>

# List configured spaces
confluence-downloader list-spaces

# Sync a specific space
confluence-downloader sync --spaceKey <key>

# Sync all configured spaces
confluence-downloader sync

# Show configuration
confluence-downloader show

Legacy Single Space Sync

For one-off space downloads without library management:

confluence-downloader sync-space \
  --baseUrl <url> \
  --apiToken <token> \
  --spaceKey <key> \
  --outputDir <dir> \
  --email <email>

Configuration

Environment Variables

| Variable | Description | |----------|-------------| | CONFLUENCE_BASE | Base URL of your Confluence instance | | CONFLUENCE_TOKEN | Confluence API token | | CONFLUENCE_EMAIL | Your Confluence account email | | CONFLUENCE_CONFIG | Path to configuration file | | CONFLUENCE_OUTPUT_DIR | Default output directory for spaces |

Configuration Files

The tool maintains two types of configuration files:

  1. confluence.json (Library configuration):
{
  "baseUrl": "https://your-domain.atlassian.net",
  "spaces": [
    {
      "spaceKey": "SPACE",
      "localPath": "space-docs",
      "lastSync": "2024-01-22T12:00:00.000Z"
    }
  ]
}
  1. space.json (Space metadata, one per space):
{
  "key": "SPACE",
  "name": "Space Name",
  "description": "Space description",
  "lastSynced": "2024-01-22T12:00:00.000Z"
}

Output Structure

The tool creates a clean, hierarchical directory structure:

output-dir/
├── space-1/
│   ├── space.json
│   ├── Page 1.md
│   └── Directory Page/
│       ├── description.md
│       ├── Child Page 1.md
│       └── Child Page 2.md
└── space-2/
    ├── space.json
    └── ...

Pages with children are saved as description.md inside their respective directories.

Markdown Format

Each markdown file includes:

  • YAML frontmatter with metadata
  • Original Confluence content
  • Comments section (if any)

Example:

---
title: Page Title
labels:
  - label1
  - label2
author: John Doe
lastUpdated: 2024-01-22T12:00:00.000Z
confluence:
  id: 123456
  version: 5
  space: SPACE
---

# Page Title

Page content in markdown format...

---

## Comments

### Jane Smith (Jan 20, 2024)
Comment content in markdown format...

Requirements

  • Node.js >= 18.0.0
  • A valid Confluence API token
  • Confluence Cloud instance

License

MIT