0.5.0 • Published 7 months ago

zerotier-service v0.5.0

Weekly downloads
4
License
MIT
Repository
github
Last release
7 months ago

What

Helper functions for talking to the ZeroTier service json api.

Example

const Service = require('./index.js')

const authToken = 'contents-of-authtoken.secret'
const service = new Service({ authToken })

// promise/async
run()
async function run () {
  try {
    const { body } = await service.info()
    console.log(JSON.stringify(body, 0, 4))
  } catch (e) {
    console.log(e.message)
  }
}

// callback
service.status(function (err, res, body) {
  if (err) console.error(err.message)

  console.log(JSON.stringify(body, 0, 4))
})

API

  • host and port default to localhost:9993
  • authToken should be the contents of ${ZEROTIER_HOME}/authtoken.secret
  • callback/promise signature is from nanorequest
  • see ./bin.js

methods

  • info()
  • join(networkId)
  • leave(networkId)
  • network(networkId)
  • networks()
  • peer(nodeId)
  • peers()
  • status()
  • set(networkId, {allowManaged,allowPublic,allowDefault}, t/f)
0.5.0

7 months ago

0.4.0

9 months ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.1

6 years ago