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

0.2.1 • Public • Published

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

Package Sidebar

Install

npm i ts-syncthing

Weekly Downloads

0

Version

0.2.1

License

LGPL-3.0-or-later

Unpacked Size

63.9 kB

Total Files

9

Last publish

Collaborators

  • 8lambda8