-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
81 additions
and
21 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,73 @@ | ||
# joplin api | ||
# joplin-api | ||
|
||
A JavaScript wrapper for the Joplin API written in TypeScript. It provides complete type definitions and covers all currently documented APIs. | ||
[![npm version](https://badge.fury.io/js/joplin-api.svg)](https://www.npmjs.com/package/joplin-api) | ||
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) | ||
|
||
Official documentation: <https://joplinapp.org/help/api/references/rest_api/> | ||
A JavaScript wrapper library for accessing the Joplin Data API, providing type-safe and intuitive interfaces. | ||
|
||
## Features | ||
|
||
- 🚀 Support multiple runtime environments: Browser, NodeJS and Joplin plugin | ||
- 📦 Complete TypeScript type definitions | ||
- 🔒 Type-safe API calls | ||
- 📚 Compliant with official API specifications | ||
|
||
## Installation | ||
|
||
```bash | ||
npm install joplin-api | ||
# or | ||
yarn add joplin-api | ||
# or | ||
pnpm add joplin-api | ||
``` | ||
|
||
## Quick Start | ||
|
||
### REST API Mode (Browser/NodeJS) | ||
|
||
```typescript | ||
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) | ||
|
||
```typescript | ||
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: | ||
|
||
- [Joplin Official REST API Documentation](https://joplinapp.org/help/api/references/rest_api/) | ||
- [Project TypeScript Type Definitions](https://joplin-utils.rxliuli.com/en-US/api/joplin-api/) | ||
|
||
## Contributing | ||
|
||
Issues and Pull Requests are welcome! | ||
|
||
## License | ||
|
||
MIT License | ||
|
||
--- | ||
|
||
> 📝 Note: To use REST API mode, you need to enable Web Clipper service in Joplin settings and obtain an authorization token first. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters