Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cbox

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cbox

Maps file directories to CouchDB databases

  • 0.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

FAQs

Package last updated on 11 Jun 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc