gobot-pocketbase
TypeScript icon, indicating that this package has built-in type declarations

0.22.20-14 • Public • Published

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 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 the postinstall 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 gobot-pocketbase@0.22.20 --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.

Dependents (0)

Package Sidebar

Install

npm i gobot-pocketbase

Weekly Downloads

18

Version

0.22.20-14

License

MIT

Unpacked Size

6.1 kB

Total Files

8

Last publish

Collaborators

  • benallfree