0.4.0-alpha.3-alpha.21 • Published 1 month ago

gobot-litestream v0.4.0-alpha.3-alpha.21

Weekly downloads
-
License
ISC
Repository
github
Last release
1 month ago

Gobot

npm.io npm.io npm.io npm.io

litestream via npm

This package allows you to use litestream as an npm dependency.

Part of the Gobot project.

Usage

Quick run

npx gobot litestream --version

Quick use

npm i gobot
import { gobot } from 'gobot'
const bot = await gobot(`litestream`)
bot.run([`--version`])

Basic version locking

npm i gobot-litestream

With gobot-litestream present, Gobot will default to the litestream version corresponding to the gobot-litestream version you installed. Now you can use litestream as a real dependency.

import { gobot } from 'gobot'
const bot = await gobot(`litestream`)
bot..run([`--version`])

Locking to a specific version

The gobot-litestream package version always mirrors the underlying litestream version:

npm i gobot-litestream@0.4.0-alpha.3

Override the default version imposed by this package

In rare cases, you may want to intentionally run a different version of litestream even though gobot-litestream is installed.

// Run a specific version (override)
const bot = await gobot(`litestream`, { version: `0.4.0-alpha.3` })
bot.run([`--version`])

// Or the latest version (override)
const bot = await gobot(`litestream`, { version: `*` })
bot.run([`--version`])

Pass environment variables

import { gobot } from 'gobot'
const bot = await gobot(`litestream`, {
  env: process.env, // This is not always necessary, but some apps do need it
})
bot.run([`--version`])

Install globally for CLI access

Exactly one gobot-litestream can be installed globally. It will receive a bin alias:

npm i -g gobot-litestream
litestream --help

# Upgrade to  @latest or any version
npm i -g gobot-litestream@latest

CLI

gobot-litestream comes with a bin shortcut for CLI usage.

litestream [options]

litestream (https://litestream.io) runner for Gobot (https://github.com/benallfree/gobot)

Options

NameDefaultDiscussion
--g-vtrueShow informational output
--g-vvfalseShow even more output
--g-vvvfalseShow even more output
--g-cache-pathhost specificThe cache path to use
--g-use-version*Run a specific binary version (format: x.y.z semver or x.y.* semver range)
--g-oshost specificSpecify OS/Platform
--g-archhost specificSpecify OS/Platform

API

Full API docs

Sample project

View the litestream sample project on github.

Try Gobot's other apps

Gobot has a growing list (currently 52) of official apps. Have you tried them all?

Getting Help

Join our Discord community.

Why?

If you are writing a nodejs application that depends upon binaries being present (like PocketHost does), you can add this package as a dependency and execute the binary via CLI or programmatically. This package will make sure your desired external binaries are always available.

If you just want to grab a binary quickly for your own use, npx gobot@latest <app> is quite a bit easier than manually downloading zips and installing binaries in shell paths. Gobot handles it all for you effortlessly.

Adding your app to the Gobot registry

We want to add native support for lots of binary apps!

If you use publish statically linked binary releases on github, you are already 98% compatible with Gobot. In fact, Gobot may already know how to work with it.

To see what initial support looks like:

npx gobot inspect <user>/<repo>

This will index all the releases from your repo and show you exactly what Gobot sees.

If you see everything you expect, you're golden. If things are missing, it may mean some custom programming. Either way, jump on Discord and let us know your results.

If you have the flexibility or are starting a new project, make sure your release names follows these rules:

  • Ends in .zip, .tgz, .tar.gz, .bz2
  • Include the version (semver recommended)
  • Include the platform (freebsd, darwin, linux, win32)
  • Include the architecture (arm64, x64, ia32, arm)

Note: GoReleaser is a great option if you're publish a Go-based project.

Contributing

We could use help testing and making sure this works across lots of platforms.

To test a build locally:

pnpm test

All known releases

gobot-litestream versions mirror litestream versions. Gobot knows about 22 releases of litestream:

Versionlinuxdarwinwin32
0.4.0-alpha.3arm64/x64
0.3.13arm64/x64arm64/x64
0.3.12arm64/x64arm64/x64
0.3.11arm64/x64arm64/x64
0.3.11-beta2arm64/x64
0.3.11-beta1arm64/x64x64
0.3.10x64
0.3.10-beta2
0.3.10-beta1
0.3.9arm64/x64x64
0.3.8arm64/x64x64
0.3.8-beta0arm64/x64
0.3.7arm64/x64x64x64
0.3.6arm64/x64x64x64
0.3.5arm64/x64x64x64
0.3.4arm64/x64x64x64
0.3.3x64x64x64
0.3.2x64x64
0.3.1x64x64
0.3.0x64x64
0.2.0x64
0.1.0x64