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 🙏

© 2026 – Pkg Stats / Ryan Hefner

gip-remote

v1.2.3

Published

Git+Pear remote DB for handling git data

Downloads

976

Readme

gip-remote

Git-into-Pear remote database. Store and replicate p2p Git repositories HyperDB.

Git objects are stored raw, and rebuilt to file when needed. Built for the Git+Pear remote transport.

npm install gip-remote

Usage

const Corestore = require('corestore')
const Hyperswarm = require('hyperswarm')
const { Remote } = require('gip-remote')

const store = new Corestore('./my-store')
const swarm = new Hyperswarm()
swarm.on('connection', (conn) => {
  store.replicate(conn)
})

// new remote
const remote = new Remote(store.namespace('my-repo'), 'my-repo')
await remote.ready()

console.log(remote.key) // public key

// remote remote!
const remote2 = new Remote(
  store.namespace('my-other-repo'),
  'git+pear://0.1.iain5rkqfenyjrcod53tb61cq3egpwbk6cnd15ca3pqm39g7wf1y/my-other-repo'
)
await remote2.ready()

Push

// objects is a Map of oid => { type, size, data }
await remote.push('main', commitOid, objects)

Fetch

const refs = await remote.getAllRefs()
const objects = await remote.getRefObjects(commitOid)

toDrive

Get a Hyperdrive-compatible interface for a branch. Works with mirror-drive.

const drive = await remote.toDrive('main')

const content = await drive.get('/README.md')

for await (const path of drive.list('/')) {
  console.log(path)
}

// Mirror to a local Hyperdrive
const mirror = drive.mirror(localDrive)
await mirror.done()

toDisk

Write git objects directly to a .git directory on disk.

const { toDisk } = require('gip-remote/lib/git')

const objects = await remote.getRefObjects(commitOid)

await toDisk({
  gitDir: '/path/to/repo/.git',
  objects,
  refs: { 'refs/heads/main': commitOid },
  head: 'main'
})

API

const remote = new Remote(opts)

Create a new remote.

  • opts.name - repository name
  • opts.store - a Corestore instance
  • opts.swarm - a Hyperswarm instance
  • opts.key - optional public key to open an existing remote
  • opts.timeout - peer discovery timeout in ms (default 240000)

remote.key

Public key of the underlying Hypercore.

remote.discoveryKey

Discovery key used for swarming.

await remote.push(branch, commitOid, objects)

Push a commit. objects is a Map<oid, { type, size, data }>.

await remote.getAllRefs()

Returns an array of { ref, oid }.

await remote.getBranchRef(branch)

Returns { ref, oid } or null.

await remote.getRefObjects(commitOid)

Returns all stored objects for a commit.

await remote.getObject(oid)

Get a single object by OID.

const drive = await remote.toDrive(branch)

Returns a RemoteDrive or null if the branch doesn't exist. The drive is compatible with mirror-drive.

await toDisk(opts)

Write git objects to a .git directory.

  • opts.gitDir - path to the .git directory (required)
  • opts.objects - array of { type, id, size, data } (required)
  • opts.refs - object mapping ref names to OIDs, e.g. { 'refs/heads/main': commitOid }
  • opts.head - branch name to set HEAD to, e.g. 'main'
  • opts.objectFormat - hash algorithm, only 'sha1' supported (default)
  • opts.verifySizes - verify declared sizes match buffer lengths (default true)

License

Apache-2.0