0.2.1 • Published 7 months ago

ts-syncthing v0.2.1

Weekly downloads
-
License
LGPL-3.0-or-later
Repository
github
Last release
7 months ago

ts-syncthing

syncthing rest api binding for typescript

not all endpoints are implemented yet

Install

To install the latest version of this library:

$ npm install ts-syncthing@latest

Usage

Setup

import { syncthing } from "../src/syncthing";

const st = new syncthing({
  apiKey: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",

  host: "excample.com", // IP or Hostname, default: "127.0.0.1"
  path: "/syncthing", // Path to syncthing,  default: ""
  port: 443, // default: 8384
  https: true, // default: false
  timeout: 2_000, // ms, default 10s
});

Requesting

// with Callback
st.system.ping((res, err) => {
  // do something
});

// with Promise
st.system
  .ping()
  .then((res) => {
    // do something
  })
  .catch((err) => {
    // do something
  });

// or await promise
const response = await st.system.ping();
0.2.1

7 months ago

0.2.0

7 months ago

0.1.11

8 months ago

0.1.10

8 months ago

0.1.9

8 months ago

0.1.8

8 months ago

0.1.7

8 months ago

0.1.6

8 months ago

0.1.5

8 months ago

0.1.4

8 months ago

0.1.3

8 months ago

0.1.2

8 months ago

0.1.1

8 months ago

0.1.0

8 months ago

1.0.0

8 months ago