1.0.1 • Published 5 years ago

node-snapd v1.0.1

Weekly downloads
2
License
Apache-2.0
Repository
github
Last release
5 years ago

node-snapd

nodejs client interface to ubuntu core snapd rest api

With node-snapd, you can now easily introspect the Snapd host and the installed Snap packages.

API Documentation

const Snapd = require('node-snapd')

let snapd = new Snapd()

const snapList = await snapd.listSnaps()
console.log(snapList)

const coreInfo = await snapd.info({name: 'core'})
console.log(coreInfo)

When run with elevated permissions you can also install and configure applications in the system.

const vectrId = await snapd.install({name: 'vectr'})

Defaults

  • SnapClient.authFile: $HOME/.snap/auth.json
  • SnapClient.socketPath: /run/snapd.socket

Developing

To develop you will need to install

  • nodejs
  • yarn
  • snapd

To interactively develop run:

yarn
yarn watch

Tests

To run tests:

yarn test

Further Reading

Credits

node-snapd is open source software developed by RosHub Inc.

  • Philetus Weller
  • Alan Meekins