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

preserve-cli

v0.0.9

Published

Deploy HTML pages, static assets and entire websites to the Bitcoin blockchain.

Downloads

17

Readme

license

Preserve CLI

Deploy HTML pages, static assets and entire websites to the Bitcoin blockchain.

Getting started

The Preserve CLI can be used to deploy files from any folder on your computer, and works great with any static site generator.

1. Install Preserve CLI

Install the Preserve CLI on your machine.

npm install -g preserve-cli

2. Add Preserve to your project

From the root directory of your web project, initialise Preserve.

preserve init

A new Bitcoin address and private key are generated and saved to a hidden .bit file in your working directory. Remember to add it to your .gitignore file.

You'll need to send a small amount of Bitcoin (SV) to deploy files. Display your wallet information to see your address and balance.

preserve wallet

3. View your sitemap

Before deploying any files, view the sitemap to see an overview of the files Preserve will deploy.

preserve status [path]
# eg: get status of assets in the 'public' folder
preserve status public

The displayed sitemap shows a list of all the files in your project, along with file size, sha256 hash, and whether the file has already been deployed or not.

4. Deploy your files

When ready to deploy the files, and assuming your Bitcoin address has enough funds, Preserve will create and send transactions for every file to the Bitcoin (SV) network.

preserve deploy [path]
# eg: deploy assets in the 'public' folder
preserve deploy public

Network rules currently limit a chain of more than 25 unconfirmed transactions. Preserve will fail if it hits this limit. If this happens, with for a confirmation, then try again.

5. Configure DNS

The final step is to configure the DNS for your domain. Preserve will generate two DNS records for you to configure with your DNS provider.

preserve dns [hostname]
# eg: generate DNS records for 'www.example.com'
preserve dns www.example.com

The generated DNS records will look like this.

Host:  www.example.com
Type:  CNAME
Data:  dns.preserve.bitpaste.app

Host:  id._bsv.www.example.com
Type:  TXT
Data:  a=138A7KoTj1hbWEfBRYQQAujRk2EV3cLoRh; s=IC5+Ldu3i0Q6KHItq316ez9Bs5a4dmjtGJUWUrPVBn50SzLWx1jm0I+CCwFvm/3lUFcRHELr6eREDHfJWUHCnRA=

The first CNAME record points requests to your domain to a Preserve Agent node to handle the request. dns.preserve.bitpaste.app is a public Preserve Agent node. Alternatively you can run the Agent on your own server.

The second TXT record contains your Bitcoin address and signature, and is used by the Agent to identify the latest router transaction associated with your domain.