Tiny API helper for Telegra.ph.
$ npm install telegra.ph --save
import Telegraph from "telegra.ph"
const client = new Telegraph()
const account = client.createAccount()
client.token = account.access_token
const pages = await client.getPageList()
console.log(pages)
import Telegraph from "telegra.ph"
const client = new Telegraph(process.env.TOKEN)
const pages = await client.getPageList()
console.log(pages)
import Telegraph from "telegra.ph"
import { Fetch } from "telegra.ph/clients"
const client = new Telegraph(process.env.TOKEN, { client: Fetch })
const pages = await client.getPageList()
console.log(pages)
.createAccount(shortName, name, url)
.createPage(title, content, authorName, authorUrl, returnContent)
.editAccountInfo(shortName, name, url)
.editPage(path, title, content, authorName, authorUrl, returnContent)
.getPage(path, returnContent)
.getViews(path, year, month, day, hour)
.getPageList(path, offset, limit)
.revokeAccessToken()