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

@qri-io/qriswitch

v0.0.4

Published

A CLI for quickly switching qri profiles

Downloads

7

Readme

qriswitch

A node CLI for switching qri profile environment variables.

Background

Qri makes use two hidden directories, .qri and .ipfs, located in the user's home directory. Together, these define the qri user's identity and collection of datasets.

Switching to a different user identity is possible if the user sets QRI_PATH and IPFS_PATH to different directories and either running Qri Desktop or running qri setup in qri CLI.

qriswitch allows for quickly changing these two environment variables to switch between multiple profiles.

Getting Started

Have nodejs and qri installed, then

  • Clone this repo
  • Install dependencies yarn
  • Install as a global command npm install -g
  • The command qriswitch should be available in your terminal

Source qriswitch's env variables file in your shell

qriswitch sets environment variables in a file $HOME/.qriswitch/.env. This file should be sourced in your shell environment:

For me, it's .bash_profile, but add this wherever your shell gets its settings.

source ~/.qriswitch/.env

Creating a New Profile

If you create a new profile using qriswitch and then open Qri Desktop, you'll have a local-only peername. You will need to run qri registry signup to register this qri peer with qri.cloud before publishing.

Switch!

Run qriswitch, you'll see a prompt to choose from existing profiles, use the default (home directory) profile, or create a new profile

current profile: chriswhong_dev
? Choose a Profile (Use arrow keys)
❯ chriswhong_dev
  ──────────────
  use default qri profile
  create a new profile

If you're using Qri CLI:

  • make sure Qri Desktop is not running
  • after switching, the current shell still thinks the previous environment variables are still in effect. Either run source ~/.qriswitch/.env or open a new terminal window to use the new profile.

If you're using Qri Desktop:

  • make sure it is not running when you switch

Profiles

Profiles are just hidden directories in $HOME/.qriswitch containing .ipfs and .qri directories.

For example, if you create a profile named myusername, qriwitch will create:

  • $HOME/.qriswitch/myusername/.qri
  • $HOME/.qriswitch/myusername/.ipfs

Creating a profile only makes these directories and sets the environment variables to

Environment Variables

QRI_PATH and IPFS_PATH are used to override the default paths for the qri and ipfs directories ($HOME/.qri and $HOME/.ipfs, respectively)

When you choose a profile, qriswitch does two things:

  • exports both environment variables in $HOME/.qriswitch/.env, which makes them available in your shell (see above for how to 'source' this file)
  • uses launchctl setenv to make both environment variables available to Qri Desktop

This has never been tested in Windows or Linux. Give it a try and please let us know if you have any trouble by opening a github issue. PRs welcome for expansion to other environments.