This package allows you to install PocketBase binaries via npm. It automatically detects your platform and installs the correct PocketBase binary, making it easier to manage and lock version dependencies. This package is part of the Gobot registry.
You can run the latest version of PocketBase directly using npx
(for npm) or bunx
(for Bun):
npx gobot-pocketbase --version
bunx gobot-pocketbase --version
To install the latest version globally on your system:
npm install -g gobot-pocketbase
pocketbase --version
To install the latest version as a dependency in your project:
bun add gobot-pocketbase@0.22.20 --trust
Then, and a way to run it as a package.json
script:
// package.json
"scripts": {
"pocketbase": "pocketbase"
}
Now try running it:
bun run pocketbase --version
Note: The
--trust
flag is required for Bun but not for other package managers. It allows thepostinstall
script to execute, installing the underlying binary.
If you want to lock to a specific version of the PocketBase binary:
bun add gobot-pocketbase@0.22.20 --trust
To lock to a specific minor version, allowing updates to patch versions but not to the major or minor version:
// package.json
"dependencies": {
"pocketbase": "^0.22.20"
}
To update to the latest version:
npm i -g gobot-pocketbase@latest
pocketbase --version
To update to the latest version of the PocketBase binary and the proxy package:
bun update gobot-pocketbase --latest --trust
bun run pocketbase --version
You can also programmatically interact with the PocketBase binary in your Node.js application using the following API:
import { binPath } from 'gobot-pocketbase'
import { spawn } from 'child_process'
spawn(binPath, [], { stdio: 'inherit' })
This example shows how to use the binPath
from the package to spawn a child process that runs the PocketBase binary.