0.0.16 • Published 2 years ago

@bugout/bugout-js v0.0.16

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

bugout-js

JavaScript client library for Bugout API

Setup

  • Install package with npm
npm install --save @bugout/bugout-js
  • Example of usage, just fill token, journal_id and entry_id with proper values from your account. Or remove unnecessary variables and API calls.
import BugoutClient, { BugoutTypes } from "@bugout/bugout-js"

const bugout = new BugoutClient()

bugout.pingBrood().then((response: BugoutTypes.BugoutPing) => console.log(response))

const token: string = ""
const journalId: string = ""
const entryId: string = ""

bugout
	.getUser(token)
	.then((response: BugoutTypes.BugoutUser) => {
		const user = response
		console.log(`User name is ${user.username}`)
	})
	.catch(() => console.log("An error occurred"))

bugout
	.getEntry(token, journalId, entryId)
	.then((response: BugoutTypes.BugoutJournalEntry) => console.log(JSON.stringify(response, null, 2)))
	.catch(() => console.log("An error occurred"))

bugout
	.search(token, journalId, "your query")
	.then((response: BugoutTypes.BugoutSearchResults) => console.log(JSON.stringify(response, null, 2)))
	.catch(() => console.log("An error occurred"))
0.0.14

2 years ago

0.0.15

2 years ago

0.0.16

2 years ago

0.0.12

2 years ago

0.0.13

2 years ago

0.0.11

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.1

3 years ago