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

@statebox/stbx-cli

v0.0.7

Published

This is a (temporary) tool that does various useful statebox things.

Downloads

15

Readme

Statebox Commandline Tool

This is a (temporary) tool that is supposed to do various useful thingss.

  • Encode & decode transactions
  • ~~Compute hashes~~
  • ~~Create EC keypairs~~
  • ~~Sign transactions~~
  • ~~Verify signatures~~
  • ~~Communicate with the API~~

Installation

npm i -g @statebox/stbx-cli

Usage

See node stbx-cli.js --help

Usage: stbx-cli [options] [command]

Options:
  -V, --version  output the version number
  -h, --help     output usage information

Commands:
  codec          work with transactions
  help [cmd]     display help for [cmd]

codec: Transaction Encoding & Decoding

When you type stbx codec --help you get this:

Usage: stbx-codec [options]

Options:
  -V, --version            output the version number
  -e, --encode             Encode message
  -d, --decode             Decode message
  -i, --input [filename]   File to read data from
  -o, --output [filename]  File to write transaction to
  -f, --force              Force file overwrite
  -h, --help               output usage information

Examples:

$ echo '{"previous":"deadc0de","firing":{"execution":"beefbabe","path":[0]}}' > file
$ cat file | stbx codec --encode
0a04deadc0de12080a04beefbabe1000
$ echo "0a04deadc0de12080a04beefbabe1000" | stbx codec --decode
{"previous":"deadc0de","firing":{"execution":"beefbabe","path":[0]}}
echo 0a04deadbeef1a420a2b0a0161100010011000100110001002100010021000100310001003100010001a01781a01791a017a1a0177120f0a017a10011801180222017322017418001800 | stbx codec --decode
{"nets":[{"name":"a","partition":[0,1,0,1,0,2,0,2,0,3,0,3,0,0],"names":["x","y","z","w"]}],"diagrams":[{"name":"z","width":1,"pixels":[1,2],"names":["s","t"]}],"labels":[0,0]}

hash: Compute Hashes

Computes hashes, pass a hexadecimal string via stdin or using a file (with -i).

$ echo 'feedc0de' | stbx hash                                     fafec8b68b40c948930d7e4f7263a1b8e9bbd543ec37d0f7b3403b6fd6066737fb75b56ac43290b9d8c1191882fc2f0c055eb06f6155c4a462c4f61d71b92e7e

convert: Conversion from GreatSPN

Convert PNPRO to statebox petrinet representation.

Usage: stbx-cli-convert [options]

Options:
  -V, --version            output the version number
  -i, --input [filename]   File to read input from
  -o, --output [filename]  File to write output to
  -F, --force              Force file overwrite
  -l, --list               List available pages (Petri nets) in PNPRO project file.
  -1, --one [name]         Extract single net by name.
  -a, --all                Extract all nets as a dictionary.
  -f, --format [format]    Specify output format: `nll` or `nbpt`.
  -h, --help               output usage information

The output format is specified with --format and is either either:

  • nbpt ~ Nano-Bipartite Graph
  • nll ~ Number List List

Usage:

# list all nets
stbx convert -i myProject.pnpro --list 

# pick one and output as NBPT
stbx convert -i myProject.pnpro --one "name" --format=nbpt
# convert all and write to `myProject.nets` as NLL
stbx convert -i myProject.pnpro --all -o myProject.nets

If you convert with --all, the output format is a JSON dictionary of either nbpt or nll object, indexed by page title.