Cleaned up joplin.js. Ready for merge into main.

This commit is contained in:
Ian Cooperman 2022-08-04 19:37:38 -07:00
parent c1ad4f0d6c
commit 5be9f56c12

View File

@ -1,7 +1,7 @@
import fetch from 'node-fetch' import fetch from 'node-fetch'
import 'dotenv/config' import 'dotenv/config'
// This class is used to interact with the Joplin Data API. It provides a method for getting notes from a specified notebook, using the notebook's ID. The fields parameter specifies which fields to include in the response.
class Joplin { class Joplin {
constructor(joplinToken, joplinPort) { constructor(joplinToken, joplinPort) {
this.token = joplinToken this.token = joplinToken
@ -40,7 +40,4 @@ class Joplin {
} }
} }
export default Joplin
let joplin = new Joplin(process.env.JOPLIN_TOKEN, process.env.JOPLIN_CLIPPER_PORT)
joplin.getNotesFromNotebook(process.env.JOPLIN_NOTEBOOK_ID, ["id", "title", "body", "created_time", "latitude", "longitude", "altitude", "is_todo", "todo_due", "todo_completed"])
.then(res => console.log(res))