gobot-pocketbase
v0.22.20-14
Published
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](https://github
Downloads
74
Readme
PocketBase for npm
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.
Usage
Run the Latest Version of PocketBase
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
Globally Install the Latest Version
To install the latest version globally on your system:
npm install -g gobot-pocketbase
pocketbase --version
Install as a Dependency
To install the latest version as a dependency in your project:
bun add [email protected] --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.
Lock to a Specific Version
If you want to lock to a specific version of the PocketBase binary:
bun add [email protected] --trust
Lock to a Minor Version
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"
}
Update to the Latest Version Globally
To update to the latest version:
npm i -g gobot-pocketbase@latest
pocketbase --version
Update to the Latest Version in Your Project
To update to the latest version of the PocketBase binary and the proxy package:
bun update gobot-pocketbase --latest --trust
bun run pocketbase --version
API
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.