Joplin API - JavaScript/TypeScript

It has been 5 years since the first version of the joplin-api npm package was released, and today I am releasing v1.0.0. Here is a detailed introduction.

npm version
License: MIT

A JavaScript wrapper library for accessing the Joplin Data API, providing type-safe and intuitive interfaces.

Features

  • :rocket: Support multiple runtime environments: Browser, NodeJS and Joplin plugin
  • :package: Complete TypeScript type definitions
  • :lock: Type-safe API calls
  • :books: Compliant with official API specifications

Installation

npm install joplin-api
# or
yarn add joplin-api
# or
pnpm add joplin-api

Quick Start

REST API Mode (Browser/NodeJS)

import { joplinDataApi } from 'joplin-api'

const api = joplinDataApi({
  type: 'rest',
  token: 'your-token-here',
  baseUrl: 'http://localhost:41184',
})

// Get note list
const notes = await api.note.list()
console.log(notes)

Plugin Mode (Joplin Plugin)

import { joplinDataApi } from 'joplin-api'

const api = joplinDataApi({
  type: 'plugin',
})

// API call example
const notes = await api.note.list()

Documentation

For complete API documentation, please refer to:

Contributing

Issues and Pull Requests are welcome!

License

MIT License


:memo: Note: To use REST API mode, you need to enable Web Clipper service in Joplin settings and obtain an authorization token first.

5 Likes