decentium
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

decentiumjs Package Version

JavaScript library for interacting with the decentralized publishing platform Decentium.

Installing

With Yarn:

yarn add decentium

With NPM:

npm install --save decentium

Example

Fetch the top post in a category and render it as HTML to stdout using Node.js:

const {ApiClient, EosjsDataProvider, render} = require('decentium')
const {JsonRpc} = require('eosjs')
const fetch = require('node-fetch')

const rpc = new JsonRpc('https://eos.greymass.com', {fetch})
const dataProvider = new EosjsDataProvider(rpc)
const client = new ApiClient({dataProvider})

async function main() {
    const trending = await client.getTrending({category: 'art', limit: 1})
    const post = await client.resolvePost(trending.posts[0])
    console.log(render(post.doc))
}

main().catch((error) => console.warn(error))

Readme

Keywords

none

Package Sidebar

Install

npm i decentium

Weekly Downloads

2

Version

1.1.1

License

MIT

Unpacked Size

85.2 kB

Total Files

12

Last publish

Collaborators

  • jnordberg