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

hyperlog-sneakernet-replicator

v1.1.5

Published

peer to peer replication for hyperlog using files you can send around on a USB stick

Downloads

12

Readme

hyperlog-sneakernet-replicator

Peer to peer replication for a hyperlog using files you can send around on a USB stick

Default hyperlog replication uses a Level database. LevelDOWN is the default backend on the filesystem, and it reads/writes many different files to the filesystem in order to function.

However, USB sticks have different write properties than what you'd find in a laptop, and can be pulled from the system at any time.

hyperlog-sneakernet-replicator stores the entire Level DB as a single tar.gz file, using a temp directory on the local FS to perform the actual replication with a hyperlog.

For further safety, opts.safetyFile can be set to true to only clobber the previous gzipped tarball once the new one has been copied to the media alongside it.

example

var replicate = require('hyperlog-sneakernet-replicator')
var level = require('level')
var hyperlog = require('hyperlog')

var db = level('log.db')
var log = hyperlog(db, { valueEncoding: 'json' })

replicate(log, '/media/usb/log.tgz')

api

var replicator = require('hyperlog-sneakernet-replicator')

replicator(log, [opts={}], outFile, cb)

Performs replication between the hyperlog log and the tar.gz file located at outFile. If no file exists at outFile then a brand new hyperlog database will be created there and replicated to.

cb is a callback function of the form function (err) {}, and is called upon an error, or completion.

opts is optional. If opts.safetyFile is set, the final tar.gz output will be written to the media as e.g. log.tgz-123895141 in full before clobbering the real outFile.

install

With npm installed, run

$ npm install hyperlog-sneakernet-replicator

license

BSD