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

@kattebak/markdown-confluence-cli

v1.1.0

Published

Synchronize markdown files to a confluence page

Readme

Markdown to Confluence Sync Action

Sync markdown files to Confluence pages using the Confluence REST API v2/v1.

Usage

CLI Usage

markdown-confluence-sync --title <title> -f <file> -u <user> -t <token> -p <page_id> -d <domain> -s <space_id>

Parameters

  • -f, --file: Path to the markdown file to sync
  • -u, --user: Confluence username/email
  • -t, --token: Confluence API token
  • -p, --page-id: Parent page ID in Confluence
  • -d, --domain: Confluence domain (e.g., your-company.atlassian.net)
  • -s, --space-id: Confluence space ID
  • -l --title: Page title (inferred from the path otherwise)

Example

Create a new page, or update an existing page:

npx @kattebak/markdown-confluence-cli sync -l "Markdown to Confluence" -f README.md -u $CONFLUENCE_USER -t $CONFLUENCE_TOKEN -d $CONFLUENCE_DOMAIN -i $CONFLUENCE_SPACE

In this case, @kattebak/markdown-confluence-cli will:

  • Create the page if it doesn't exist
  • Or find the page by title
  • Upload images found in markdown
  • Update the page to reference confluence page attachments
sequenceDiagram
    participant CC as ConfluenceClient
    participant PA as PageApi (v2)
    participant CAA as ContentAttachmentsApi (v1)
    participant AA as AttachmentApi (v2)
    participant FS as File System

    Note over CC: Initial Create Operation
    CC->>PA: createPage(document)
    PA-->>CC: pageId

    Note over CC: Update with Inline Images
    CC->>CC: updatePageWithInlineImages(pageId, document)
    CC->>CC: traverseForLocalFiles(document)
    CC->>CC: Find local file references in mediaSingle nodes

    rect rgb(255, 255, 200)
        Note over CC, FS: loop [For each local file]
        CC->>FS: Check file exists
        FS-->>CC: File buffer

        Note over CC, CAA: Upload using v1 API
        CC->>CAA: uploadAttachment(pageId, filePath)
        CAA->>CAA: createOrUpdateAttachments()
        CAA-->>CC: attachmentInfo (id, title, mediaType)

        Note over CC, AA: Get details using v2 API
        CC->>AA: getAttachment(attachmentId)
        AA->>AA: getAttachmentById()
        AA-->>CC: attachmentDetails (fileId, downloadLink)

        Note over CC: Update media node with attachment info
        CC->>CC: Set attrs: id=fileId, collection=contentId-pageId, type=file
    end

    CC->>PA: getPage(pageId)
    PA-->>CC: currentPage (version info)
    CC->>PA: updatePage(pageInfo, updatedDocument)
    PA-->>CC: Updated page with attachments

Documentation

This implementation has been completely reverse-engineered, because Atlassian provides no documentation on how to deal with the adf format in the REST api. By uploading pages in adf you get the modern rendering behaviour and editor. If you don't care for any of that, you could simply post HTML with inlined images instead.

  • https://github.com/marketplace/actions/markdown-to-confluence-sync
  • https://www.npmjs.com/package/@telefonica/markdown-confluence-sync

I learned a lot from studying these implementations as well.

Development

Test cli in development:

tsx src/cli.ts sync -f README.md -u $CONFLUENCE_USER -t $CONFLUENCE_TOKEN -d $CONFLUENCE_DOMAIN -i $CONFLUENCE_SPACE_ID