UMD (including Node, Browser, and TypeScript!) Library for Mastodon API
Github repository, and npm package are available.
You can use this library universally: Node, Browser(ES5), and TypeScript.
$ npm i -S mstdn-api
There are simple examples in ./example.
if you can use import-syntax, then:
import Mastodon from 'mstdn-api'
const ACCESS_TOKEN = '......' // OAuth access_token (required)
const BASE_URL = 'mstdn.jp' // Mastodon's hostname or baseUrl (Optional)
const mstdn = new Mastodon(ACCESS_TOKEN, BASE_URL)
See documents of class Mastodon
for development: https://rawgit.com/onsen-ui/mstdn/master/dist/mastodon.min.js provided by rawgit.com
variable 'Mastodon' (window.Mastodon) is globally exported.
/* global Mastodon */
const mastodon = new Mastodon('YOUR_ACCESS_TOKEN')
See documents of class Mastodon
./dist/mastodon.js is generated by webpack (as bundler)
and ./dist/mastodon.min.js is generated by uglifyJS
Documents automatically generated by Typedoc2.
At first, see ./docs/classes/_mastodon_.mastodon.html
hosted by rawgit: documents of class Mastodon
Feel free to contact me.
Welcome to blush my English and the code up.