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

@tinyverse.space/web3storage

v0.0.42

Published

Tinyverse web3storage JavaScript API client

Downloads

54

Readme

Getting started

Install the package using npm

npm install @tinyverse.space/web3storage

or yarn:

yarn add @tinyverse.space/web3storage

See [the getting started docs][w3storage-docs-w3name-getting-started] for more information.

You can also find full API reference documentation for the client at https://tinyverse-web3.github.io/web3storage

Usage

The web3stoage package exposes several "top-level" or module-scoped functions like , , and , along with a few classes like and that are returned from and accepted by the API functions.

In the examples below, the module is imported as Name using the ES module import syntax:

import * as Web3storage from '@tinyverse-space/web3storage'

const userPk = "0x5448862c64c6bEFc44ED957FAd45F22aeeDaC800";
const ipfsStorage = await Web3Storage.createIpfsStorage(userPk, {
  autoSync: true,  // default true
  syncTryTimeout: 5000, // default 5000ms
  syncCallback: msg => console.info(msg)
})

// setSyncCallback set synchronization callback, which will be called back after synchronizing the remote IPFS node
ipfsStorage.setSyncCallback((msg: any) => {
    console.info(msg)
})

// put user data to local ipfs node
await ipfsStorage.put('note', { 0: "hello world" })

// get user data from local ipfs node
const data = await ipfsStorage.get('note')
console.info(data)

// resume user data from remote ipfs node
await ipfsStorage.resume()

Configuration

http {
    ......
    server {
        listen       443 ssl;
        server_name  localhost;
   
        proxy_connect_timeout    600;
        proxy_read_timeout       600;
        proxy_send_timeout       600;

        ssl_certificate      /Users/dujuan/work/ssl/server.pem;
        ssl_certificate_key  /Users/dujuan/work/ssl/server.key;

        ssl_session_cache    shared:SSL:1m;
        ssl_session_timeout  5m;

        ssl_ciphers  HIGH:!aNULL:!MD5;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_prefer_server_ciphers  on;
 
        location /ipfs/api/v0/name/publish {
            add_header 'Access-Control-Allow-Origin' '*' always;
            add_header 'Access-Control-Request-Method' '*' always;
            add_header 'Access-Control-Allow-Credentials' 'true' always;
            add_header 'Access-Control-Allow-Headers' '*' always;
            if ($request_method = 'OPTIONS') {
                return 204;
            }
            proxy_pass http://localhost:5001/api/v0/name/publish;
            proxy_set_header Host $host;
        }
        ......
    }
    ......
}