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

confluence-data-center-client

v1.0.1

Published

TypeScript client library for Confluence Server/Data Center REST API

Readme

Confluence Data Center Client

TypeScript client for Confluence Server/Data Center REST API.

Installation

npm install confluence-data-center-client

Usage

import { ConfluenceClient } from 'confluence-data-center-client';

const client = new ConfluenceClient({
  baseUrl: 'https://confluence.example.com',
  token: 'your-personal-access-token',
});

// List spaces
const spaces = await client.spaces.list();

// Get a space
const space = await client.spaces.get({ spaceKey: 'DOCS' });

// Search with CQL
const results = await client.search.query({
  cql: 'space = DOCS AND type = page AND text ~ "important"',
});

// Get a page
const page = await client.pages.get({ pageId: '12345', expand: 'body.storage,version' });

// Get a historical version of a page
const oldPage = await client.pages.get({ pageId: '12345', version: 3, status: 'historical' });

// Create a page
const created = await client.pages.create({
  spaceKey: 'DOCS',
  title: 'New Page',
  body: '<p>Page content in storage format</p>',
});

// Update a page
await client.pages.update({
  pageId: '12345',
  title: 'Updated Title',
  body: '<p>Updated content</p>',
  version: 2,
});

// Delete a page
await client.pages.delete({ pageId: '12345' });

// Get child pages
const children = await client.pages.getChildren({ pageId: '12345' });

// Get page history
const history = await client.pages.getHistory({ pageId: '12345' });

// Get and add comments
const comments = await client.comments.get({ pageId: '12345' });
await client.comments.add({ pageId: '12345', body: 'A comment' });

// Get and add labels
const labels = await client.labels.get({ pageId: '12345' });
await client.labels.add({ pageId: '12345', labels: [{ name: 'important' }] });

// Upload and download attachments
await client.attachments.upload({ pageId: '12345', filePath: '/path/to/file.pdf' });
await client.attachments.download({ downloadUrl: '/download/attachments/12345/file.pdf', destinationPath: '/tmp/file.pdf' });
await client.attachments.delete({ attachmentId: '67890' });

API Structure

| Domain | Methods | |--------|---------| | client.spaces | list, get | | client.pages | get, create, update, delete, getChildren, getHistory | | client.search | query | | client.comments | get, add | | client.labels | get, add | | client.attachments | get, upload, download, delete |

Authentication

Generate a Personal Access Token in Confluence: Profile > Settings > Personal Access Tokens

export CONFLUENCE_URL=https://confluence.example.com
export CONFLUENCE_TOKEN=your-token-here

Requirements

  • Node.js >= 22.0.0
  • Confluence Server/Data Center 6.0+

API Endpoints

This client uses:

  • Confluence REST API: /rest/api

Authentication: Bearer token (Personal Access Token)

License

MIT