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 🙏

© 2024 – Pkg Stats / Ryan Hefner

cbox

v0.3.0

Published

Maps file directories to CouchDB databases

Downloads

22

Readme

cbox

Build Status Coverage Status Stories in Ready NPM version

Maps a file directory into CouchDB attachments, and then pushes, pulls, or syncs with a CouchDB instance. Designed to run forever, consume minimal network traffic, and preserve file history while respecting deletions.

It's like an open-source Dropbox.

Installation

It's written in node so you'll need npm. Then:

npm install -g cbox
cbox # prints commands, usage

As an example, to continually sync a local directory to a CouchDB instance:

cbox sync --local {folder} --remote {url} --watch

That's it! cbox will watch files on the remote database and in the local folder, and will sync any changes that occur. To stop syncing, stop the process by pressing Ctrl-C or the like. To save that command for the future, use --save:

cbox sync --save --local {folder} --remote {url} --watch
cbox all # runs all saved jobs

Commands

  • pull: pull files from remote into local
  • push: push files from local up to remote
  • sync: push and pull files from and to local and remote
  • jobs: list all saved jobs
  • rm: remove a saved job, without modifying any remote or local copy
  • all: run all saved jobs

Options

  • --local: a local folder, like ~/Pictures.
  • --remote: a remote database, like a CouchDB instance.
  • --save: save the given command for later re-use.
  • --watch: continue watching and reacting to changes indefinitely.
  • --config: path to a non-default file to use for saving and reading configuration values. Defaults to ~/.cbox.json.
  • --log: indicates level for logging. Choose from error, warn, info, verbose, debug, and silly.

Running on Startup

N.B. These instructions are for *nix systems, like Linux and Mac OS X

Using forever and cron, you can set cbox to run on a regular basis. Like this:

npm install -g forever
echo '@reboot' `which node` `which forever` '--minUptime 1' `which cbox` '--log info' | crontab

That'll run all saved jobs whenever your computer starts. If cbox fails, forever will restart it.

Config

By default, jobs are saved to ~/.cbox.json. It's just JSON, so you can edit it as you please. If it becomes invalid JSON, cbox will get angry. Here's an example config file:

[
  {
    command: 'pull',
    local: '~/Pictures',
    remote: 'http://localhost:5984/pictures'
  }
]

Tests

The tests sync data with a live CouchDB instance running at http://localhost:5984. So, to run the tests, make sure you have an instance listening at that URL.

To run the tests, do npm test.

License

ISC