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

@pashoo2/p2p

v0.2.34

Published

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

Downloads

2

Readme

This project was bootstrapped with Create React App.

JEST WORKAROUND

put it on top of the testfile an uncomment to get the right Jest types instead of Mocha typings import '@types/jest';

FIREBASE CENTRAL AUTHORITY - RELATIME DATABASE

IT IS NECESSARY TO RELOAD THE BROWSER WITNODOW ON SIGN OUT FROM THE FIREBASE APP

FIREBASE DO NOT ALLOW TO SIGN UP IN ANOTHER APPLICATION IF WAS SIGNED IN ANOTHER BEFORE FOR AN UNKNOWN REASON (may be cause the default application was deleted)

FIREBASE DO NOT ALLOW TO USE THE SAME EMAIL, WHEN AUTHORIZED ON A DIFFERENT APPS FOR AN UNKNOWN REASON

IT IS NECESSARY TO ENABLE AN AUTOHORIZATION IN THE FIREBASE PROJECT

Must be set rules as

{ /* Visit https://firebase.google.com/docs/database/security to learn more about security rules. */ "rules": { ".read": true, ".write": true, "credentials": { ".read": true, ".write": "!data.exists()", ".indexOn": "firebase_user_id" } } }

instead of "credentials" must be a value of the constant "CA_CONNECTION_FIREBASE_UTILS_STORAGE_CREDENTIALS_KEY_PREFIX"

!!It is necessary to set the configuration, to prevent data filtration on the client: ".indexOn": "firebase_user_id"

version of the firebase rules which allowed userId with guid or user login as user id in the user idenitity string

It's for "01" and "02" and version of the user identities. This is default rules.

E.G. for the 'https://protocol-firebase-default-rtdb.firebaseio.com/' realtime database

{
  /* Visit https://firebase.google.com/docs/database/security to learn more about security rules. */
  "rules": {
    ".read": "true",
    ".write": "auth != null",
      "credentials": {
        "$userID": {
          ".validate": "!data.exists() && newData.exists() && ($userID.beginsWith('02https:*_S%ë5nN*_S%ë5nNprotocol-firebase-default-rtdb_P%ë5nN*firebaseio_P%ë5nN*com') || $userID.beginsWith('01https:*_S%ë5nN*_S%ë5nNprotocol-firebase-default-rtdb_P%ë5nN*firebaseio_P%ë5nN*com')) && newData.hasChildren(['credentials', 'firebase_user_id']) && newData.child('credentials').isString() && newData.child('firebase_user_id').isString() && newData.child('credentials').val().length < 9000 && newData.child('credentials').val().length > 100 && newData.child('firebase_user_id').val() === auth.uid",
          ".indexOn": "firebase_user_id",
        }
      }
  }
}

another version of the firebase rules which allowed userId only with the auth.uid in the user idenitity string this version of the rules must be used if the user allowed only a one user identity per account

{
  "rules": {
    ".read": "true",
    ".write": "auth != null",
      "credentials": {
        "$userID": {
          ".validate": "!data.exists() && newData.exists() && $userID === '02https:*_S%ë5nN*_S%ë5nNprotocol-firebase-central-default-rtdb_P%ë5nN*firebaseio_P%ë5nN*com|' + auth.uid + '_D%5nNë*' && newData.hasChildren(['credentials', 'firebase_user_id']) && newData.child('credentials').isString() && newData.child('firebase_user_id').isString() && newData.child('credentials').val().length < 5000 && newData.child('credentials').val().length > 100 && newData.child('firebase_user_id').val() === auth.uid",
          ".indexOn": "firebase_user_id"
        }
      }
  }
}

CREDENTIALS STORAGE FORMAT

The key for the credentials storage value is a crypto hash from the user login The value is salt which is encrypted by the crypto key produced by the login The crypto credentials are encrypted by the login + password

RESTRICTIONS FOR ORBIT DB

Any database closed once can't be opened till the instance of the SwarmStorage not be reopened. The workaround for it may be the following:

  • do not close the databse till the user is logged in or not close a broser's tab.
  • all closed databases may be muted.
  • in the window.onbeforeunload or on the SwarmStorage 'close' event listener, close all the databases, which were closed before.

TODO

for performance reason it's necessary to implement in-memory (or not encrypted) storage for databases

which are like pubsub channels (for example this kind of storage must be used for geolocation sharing or collaborative document editing).

for performance reason it's necessary to improve the performance of the secret storage

to do not encrypt each key - value, but encrypt all data when loading or closing. All data must be stored in-memory and then replicated to any storage? encrypted. And when a data loaded from the storage it's necessary to ecrypt it.

for video-chat hypervision-browser must be used as the library for sharing video data from peer to peer.