You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

flarum-client

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flarum-client

A simple client to the api of the flarum forum

0.3.0
Source
npmnpm
Version published
Weekly downloads
11
450%
Maintainers
1
Weekly downloads
 
Created
Source

Flarum-client

A simple client to the flarum forum software api.

Usage

General usage looks like this

const FlarumClient = require('flarumClient');

const settings = {
  "apiUrl": "http://example.org/api",
  "adminUsername": "username", // you will need to create an account with admin privileges on flarum
  "adminPassword": "password"
}
const flarumClient = new FlarumClient(settings);
flarumClient.getUser('username').then((user) => {
  console.log(user);
})

logging

If you want better logging, you can install bunyan and pass an instance to the init, like this:

const bunyan = require('bunyan');
const logger = bunyan.createLogger({name: "myapp"});
const flarumClient = new FlarumClient(settings, logger);

Documentation of functions

You can find the documentations of the functions (generated by jsdoc) here. Important to note is that because the functions are bound with the settings and logger object, you can ignore those two arguments on all the functions

Keywords

flarum

FAQs

Package last updated on 15 Feb 2017

Did you know?

Socket

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