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

@quaelin/idea-cli

v0.0.6

Published

CLI commands for interacting with the Idea-DAG: decentralized Idea, Relation & Perspective data

Downloads

2

Readme

@quaelin/idea-cli

CLI tool for interacting with the Idea-DAG: decentralized Idea, Relation & Perspective data. Provides convenient command-line access to the idea-api.

$ npm install -g @quaelin/idea-cli

This installs the commands idea, relation and perspective.

Note: For the commands to work, you'll need to have an IPFS daemon running. The commands will look for a daemon running on the default local port (5001), but if your daemon is running elsewhere, use the IDEA_IPFS_HTTP environment variable to specify where it can be found.

$ export IDEA_IPFS_HTTP=http://127.0.0.1:5001/api/v0

Commands

Ideas

idea add

Create a text Idea, printing its resulting iCid:

$ idea add "Not a bad idea"
QmRXZEpbAqbZtj59g7D8rWSFJ6KpAVAVhDRxNAEpwUYW4L

idea get

Fetch an Idea (or Relation) by iCid:

$ idea get QmRXZEpbAqbZtj59g7D8rWSFJ6KpAVAVhDRxNAEpwUYW4L
Not a bad idea

Relations

All of the relation commands are for creating Relations, and they all return the rCid of the created Relation. Use idea get to fetch the Relation object itself.

relation R:Analogy

$ relation R:Analogy A=<icid> B=<icid> C=<icid> D=<icid>

relation R:And

$ relation R:And A=<icid> B=<icid>

relation R:Identity

$ relation R:Identity A=<icid> B=<icid>

relation R:Implies

$ relation R:Implies A=<icid> B=<icid>

relation R:Improves

$ relation R:Improves A=<icid> B=<icid>

relation R:IsA

$ relation R:IsA A=<icid> B=<icid>

relation R:Negation

$ relation R:Negation A=<icid>

relation R:Or

$ relation R:Or A=<icid> B=>icid>

relation R:XOr

$ relation R:XOr A=<icid> B=>icid>

Perspectives

In the CLI commands below, a <pex> represents a "perspective expression", which can be either a pCid, or else a literal list of iCid=valuation pairs.

perspective average

Merge two or more perspectives together, taking the average valuation for a any given key.

$ perspective average <pex> <pex> [<pex> ...]

perspective get

Fetches the actual content of a perspective.

$ perspective get <pex>

The default (and currently only) output format is console.log() style, eg:

$ perspective get QmdE8HdS615NjvtypfF2FPZc4H7WnS5why67ueUqVdR7tZ
{
  QmWP7mJwoH9a63yB5YEGnKeVz73Trimn4783w9XCRRM1QA: 0.78,
  QmaFpVwJJc8V4tZLjD3hFTTqTquTR7QFkGy6rYhMEPELva: -0.78
}

perspective intersect

Two or more perspectives can be "intersected", resulting in a new perspective that contains only the iCids common to ALL the input perspectives. The valuations for each kept iCid will be the average of those input.

$ perspective intersect <pex> <pex> [<pex> ...]

perspective keys

Lists just the iCids from a perspective, with no valuations.

$ perspective keys QmdE8HdS615NjvtypfF2FPZc4H7WnS5why67ueUqVdR7tZ
[
  'QmWP7mJwoH9a63yB5YEGnKeVz73Trimn4783w9XCRRM1QA',
  'QmaFpVwJJc8V4tZLjD3hFTTqTquTR7QFkGy6rYhMEPELva'
]

perspective merge

Two or more perspectives can be "merged", resulting in a new perspective with all the iCid:valuation pairs of the constituent perspectives. With merge operations, there is right-to-left precedence. That is, whichever perspective is specified last in the order of arguments is the one whose valuations are used in the case of any duplicate iCids.

$ perspective merge <pex> [<pex> ...]

You can also create arbitrary perspectives using perspective merge by specifying a set of iCid=valuation pairs:

$ perspective merge <icid>=<valuation> [<icid>=<valuation> ...]

perspective neutralize

A perspective can be "neutralized", resulting in a new perspective with all valuations set to 0. Neutralizing is the same as polarizing with a polarization factor of -1.

$ perspective neutralize <pex>

perspective polarize

A perspective can be "polarized", where all valuations are adjusted by a <factor> in the range [-1, 1], where:

  • -1 is the same as neutralize (all valuations set to 0)
  • <0 means valuations get skewed towards 0
  • 0 means no change
  • >0 all negative valuations get skewed towards -1, and positive ones towards 1
  • 1 means all negative valuations become -1 and all positive ones become 1
$ perspective polarize <pex> <factor>

perspective scope

You can select a subset of a Perspective A, preserving only the iCids (and valuations) from A where the iCid is found in Perspective B. (Valuations of B are ignored.)

$ perspective scope <pex A> <pex B>

perspective skew

Two perspectives can be merged with a weighting indicating how much to skew valuations towards one or the other.

$ perspective skew <pex> <pex> <weighting>

The <weighting> value can be in the range [-1, 1], where for duplicate iCids:

  • -1 means to take the valuation from the first perspective
  • <0 means to skew towards the first
  • 0 means take a straight average
  • >0 means skew towards the second
  • 1 means take the valuation from the second perspective