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

ssb-git-repo

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ssb-git-repo

git repos in secure-scuttlebutt

  • 1.1.0
  • npm
  • Socket score

Version published
Weekly downloads
15
increased by650%
Maintainers
1
Weekly downloads
 
Created
Source

ssb-git-repo

Host git repos in secure-scuttlebutt

Example

var ssbGit = require('ssb-git-repo')
var repoId = '%CBeVWA9eYt6OhJDXFtqas6kWb5LwaJxYtfwDazKvh4U=.sha256'

// get a single repo:
ssbGit.getRepo(sbot, repoId, function (err, repo) {
  if (err) throw err
  // do something with the repo
})

API

ssbGit.createRepo(sbot[, options], cb(err, repo))

Create a repo. Publishes a message announcing the new repo.

  • sbot: a scuttlebot or ssb-client object
  • options.forks: message ID of a repo of which this repo is considered a fork
  • options.live: keep the repo updated as changes are pushed to it
  • cb: function called when the repo is created
  • err: error creating the repo, if any
  • repo: ssbGit.Repo object for the new repo
ssbGit.getRepo(sbot, repoId[, options], cb(err, repo))

Get a repo.

  • sbot: a scuttlebot or ssb-client object
  • id: ID of the SSB message that started the repo
  • options.live: keep the repo updated as changes are pushed to it
  • cb: function called when the repo is retrieved
  • err: error retrieving the repo, if any
  • repo: ssbGit.Repo object for the retrieved repo
ssbGit.repos(sbot, options): source(repo)

Get repos from the feed

  • sbot: a scuttlebot or ssb-client object
  • options: options to pass to sbot.createFeedStream
  • repo: ssbGit.Repo object
ssbGit.Repo

An abstract-pull-git-repo-compliant git repo object. Additional methods:

repo.close(cb(err))

Close the repo's update stream.

  • cb: function called when the repo's stream is closed
  • err: error closing the repo, if any

TODO

  • reuse index between a user's repos
  • handle push with more object IDs than fit in a message

License

Copyright (c) 2016 Charles Lehner

Usage of the works is permitted provided that this instrument is retained with the works, so that any entity that uses the works is notified of this instrument.

DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.

Keywords

FAQs

Package last updated on 26 Feb 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