npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

pocketbase-import

v1.0.6

Published

A CLI tool for importing CSV data into PocketBase collections with authentication support.

Readme

PocketBase CSV Importer

A command-line tool to import CSV data into a specified collection in a PocketBase instance.

Features

  • Authenticate with PocketBase using admin credentials
  • Read CSV files and import records into a specified collection
  • Supports environment variables for configuration
  • Handles errors and logs progress during import

Installation

Ensure you have Node.js installed, then install the package globally:

npm install -g pocketbase-import

Usage

pocketbase-import -c <collection> -f <file> --url <pocketbase_url> -u <username> -p <password>

Required Options:

  • -c, --collection <string>: The name of the PocketBase collection to import into.
  • -f, --file <string>: The path to the CSV file to import.

Optional Environment Variables:

Instead of passing credentials via command line arguments, you can use environment variables:

  • PB_URL: PocketBase instance URL (including port if necessary)
  • PB_USER: PocketBase admin username
  • PB_PASS: PocketBase admin password

Example using environment variables:

PB_URL="http://127.0.0.1:8090" PB_USER="[email protected]" PB_PASS="securepassword" pocketbase-import -c users -f data.csv

Example

pocketbase-import -c users -f users.csv --url http://127.0.0.1:8090 -u [email protected] -p mypassword

Error Handling

  • If authentication fails, the script will exit with an error.
  • If the CSV file is not found or cannot be read, an error message is displayed.
  • If the specified collection does not exist, the script will terminate.
  • Any failed record imports will be logged with the error message.

Debug Mode

Enable debugging by setting DEBUG=true in the script or modifying the DEBUG constant in the source code.

License

MIT License

Contributions

Feel free to open an issue or submit a pull request if you find any bugs or want to add features!


Made with ❤️ for the PocketBase community.