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

tre-init

v2.0.1

Published

Initialize and test a new ssb network

Downloads

27

Readme

tre-init

tre-init and other command line utilities for Tre.

Install

npm i -g tre-init

tre-init - Create a new ssb network and an initial message tree

cd myproject
tre-init

This creates the file .trerc and the directory .tre in the current working directory. .trerc serves the same purpose as ~/.ssb/config in traditional ssb setups. Additionally, it contains ssb message keys of some of the branches that were created by tre-init. A new, random network-id was created, port numbers also are random (above 50000 and below 65000)

Data is stored in .tre, it replaces ~/.ssb in traditional ssb setups.

In case they did not exist before, new keypairs were created in .tre/secret and .tre/browser-keys

Run sbot with the local config

tre-bot is a simple wrapper around sbot (scuttlebot). It instructs sbot to use the local config. You can run it from anywhere inside your project tree, it will pick up the closest .trerc file.

tre-bot server

Create a pub

tre-pub-config | ssh myserver.com 'mkdir -p .myappname && cat - > .myappname/config'
# run `ssb_appname=myappname sbot server` on your server
ssh korn 'ssb_appname=myappname sbot getAddress' > .tre/remotes
# edit .tre/remotes so that it looks something like
{
  "myserver": "net:138.231.111.84:42632~shs:6odsaDg5OpsFlfa7LLSLxikxF5ze4DN03bAz6vrz7uMQ="
}

## Crete an invite code

tre-invite > invite.json


This invite code can be pasted into bay-of-plenty. It will instruct the pub to follow the user, the user to follow the pub and you, and give the user a name you can specify in invite.json.

## deploy an application

tre-apps-deploy <source.js>


browserifies source.js, uploads the result as a blob and publishes a message of type `webapp`. If a previous webapp exists and was deployed from a repo with the same `origin  remote and from the same git branch, and by the same author, that pre-existing webapp is updated. (a new revision of that webapp is posted).

Here's an example message piblished by `tre-apps-deploy`

{ "previous": "%GkSmUhYX7jM5rzHobHlUHTzgqc9LKxM8T5eRwuJW624=.sha256", "sequence": 28, "author": "@h8sMNhOo43PP8HX+9B3PCJPchqxhpPXgzwFG7HIaNbc=.ed25519", "timestamp": 1547036143789, "hash": "sha256", "content": { "type": "webapp", "name": "tre-init", "description": "Initialize and test a new ssb network", "keywords": [ "ssb", "tre" ], "config": { "tre": { "branches": { "root": "%eMe2hfQ+gI4NKQJzoycSQmefvSLKkwmdXBGj6JRQHwM=.sha256", "about": "%LQu4ZrTcuS2JhiYGAwk1Lg+Wee5M7OH74XnoSVZ1TdQ=.sha256", "machines": "%IPYCOlf24z5BeN9BSGPZfWpDIKptDbeYDnEryKldxew=.sha256", "prototypes": "%38ZbMKMoC4oVXeTZ+bx3objqO8SL3ZYXz6wLBprnmd8=.sha256", "webapps": "%lkexgs1dnCCvkOjbRyJAUnWwbk1igt4DqOhBe9U3klY=.sha256", "trash": "%152k3CQRaeK7K+hZy41QCo8aRZjaUg6SyfgG8FeGeLo=.sha256" } } }, "codeBlob": "&IBbpG0szrPmtzbPwXKN0ZijQ9KeIJpzh0JYnIrZx6SE=.sha256", "lockBlob": "&iwEhkt7JCD9tRnFzkAgRvgdeARj450Db8whC2QMbhqU=.sha256", "commit": "v1.6.0-6-g01484fd", "repository": "[email protected]:regular/tre-init.git", "repositoryBranch": "master", "revisionBranch": "%GkSmUhYX7jM5rzHobHlUHTzgqc9LKxM8T5eRwuJW624=.sha256", "revisionRoot": "%39L6vcMxCbcDrRUJyUWSJd2oJ5mA55aG0ecNNijlSaw=.sha256", "change-log": [ "01484fd5aa5c0376e02df540dbee7d63a7239992 Add tre-apps-deploy to Readme" ] }, "signature": "rtkZoJkNRDoWUi39gU+LMmVfkOODLdLM/B7sSnbpXNG02/H21DhNazmEmK5ZbUJrEw5R6HgBJLaSY0G+shbUCw==.sig.ed25519" }

---

Licsense: AGPLv3 - Copyright 2019 Jan Boelsche