lutim

1.0.3 • Public • Published

Node Lutim

This project provide a node api for lutim.

The source code is strongly inspired by node-imgur

Module usage

Installation

npm install lutim

Usage

Requiring the module

var lutim = require('lutim');

setApiUrl(url: String)

By default node-lutim url will be https://framapic.org/. You can change it using setApiUrl(url).

lutim.setApiUrl(lutimUrl);

getApiUrl()

Getter for the current api url.

Returns a String

lutim.getApiUrl() // => 'http://myUrl/'

getServerInfos(): Promise

See https://framagit.org/fiat-tux/hat-softwares/lutim/wikis/API#get-informations-about-the-server

Returns a Promise

lutim.getServerInfos()
  .then(function (res) {
    // Handle res
  })
  .catch(function (err) {
    // Handle err
  })

uploadImage(filePath: String, deleteDay?: number, firstView?: number, keepExif?: number, crypt?: number): Promise

See https://framagit.org/fiat-tux/hat-softwares/lutim/wikis/API#add-images

Returns a Promise

lutim.uploadImage(filePath)
  .then(function (res) {
    // Handle res
  })
  .catch(function (err) {
    // Handle err
  })
 
lutim.uploadImage(filePath, deleteDay, firstView, keepExif, crypt)
  .then(function (res) {
    // Handle res
  })
  .catch(function (err) {
    // Handle err
  })

deleteImage(realShort: String, token: String): Promise

See https://framagit.org/fiat-tux/hat-softwares/lutim/wikis/API#delete-images

Returns a Promise

lutim.deleteImage(realShort, token)
  .then(function (res) {
    // Handle res
  })
  .catch(function (err) {
    // Handle err
  })

modifyImage(realShort: String, token: String, deleteDay: number, firstView?: number): Promise

See https://framagit.org/fiat-tux/hat-softwares/lutim/wikis/API#modify-images

Returns a Promise

lutim.modifyImage(realShort, token, deleteDay)
  .then(function (res) {
    // Handle res
  })
  .catch(function (err) {
    // Handle err
  })
 
lutim.modifyImage(realShort, token, deleteDay, firstView)
  .then(function (res) {
    // Handle res
  })
  .catch(function (err) {
    // Handle err
  })

getImage(short: String): Promise

See https://framagit.org/fiat-tux/hat-softwares/lutim/wikis/API#get-images

Returns a Promise

lutim.getImage(short)
  .then(function (res) {
    // Handle res
  })
  .catch(function (err) {
    // Handle err
  })

getImageInfos(real_short: String): Promise

See https://framagit.org/fiat-tux/hat-softwares/lutim/wikis/API#get-informations-about-an-image

Returns a Promise

lutim.getImageInfos(realShort)
  .then(function (res) {
    // Handle res
  })
  .catch(function (err) {
    // Handle err
  })

getImageCountAndStatus(short: String, token: String): Promise

See https://framagit.org/fiat-tux/hat-softwares/lutim/wikis/API#get-counter-and-status-of-image

Returns a Promise

lutim.getImageCountAndStatus(short, token)
  .then(function (res) {
    // Handle res
  })
  .catch(function (err) {
    // Handle err
  })

Credit

The code is inspired by node-imgur

Made for lutim

Readme

Keywords

none

Package Sidebar

Install

npm i lutim

Weekly Downloads

86

Version

1.0.3

License

MIT

Unpacked Size

22.8 kB

Total Files

18

Last publish

Collaborators

  • dylanderv