Socket
Socket
Sign inDemoInstall

decentium

Package Overview
Dependencies
34
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    decentium

JavaScript library for interacting with Decentium


Version published
Weekly downloads
2
decreased by-50%
Maintainers
1
Install size
6.23 MB
Created
Weekly downloads
 

Readme

Source

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))

FAQs

Last updated on 07 Mar 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc