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-js

v0.0.31

Published

[![Build Status](https://travis-ci.com/statebox/stbxjs.svg?token=sQRsYRm6gqSjs7qsYUZp&branch=master)](https://travis-ci.com/statebox/stbxjs)

Downloads

12

Readme

Build Status

@statebox/stbx-js

All that this does is bundle stbx-core-js for node and the browser.

The build is published by Travis-CI to @statebox/stbx-js

Usage

Node

npm install --save @statebox/stbx-js
let Stbx = require("@statebox/stbx-js")

// create protocol instance
let mynet = {name:"a", partition: [0,1,0,1,0,0], names:["x","y"]}
let mydiagram = {name:"z", width:1,pixels:[1,2],names:["s","t"]}
let s = new Stbx({
    nets: [mynet],
    diagrams: [mydiagram],
    labels: [0, 0] // both nodes in the diagram point to net "a"
});
 
// count the number of transitions and places
console.log(s.transitionCount(), s.placeCount())

Browser

<script src="//unpkg.com/@statebox/stbx-js"></script>
<script> 
// create protocol instance
let mynet = {name:"a", partition: [0,1,0,1,0,0], names:["x","y"]}
let mydiagram = {name:"z", width:1,pixels:[1,2],names:["s","t"]}
let s = new Stbx({
    nets: [mynet],
    diagrams: [mydiagram],
    labels: [0, 0] // both nodes in the diagram point to net "a"
});
 
// count the number of transitions and places
console.log(s.transitionCount(), s.placeCount())
</script>

decoding a transaction

<script src="//unpkg.com/@statebox/stbx-js"></script>
<script>
let whex = 
    `0a3f0a04696e697410001001100210001001100010001002100010001a0573746172741a0d737461727450726f64756365721a0d7374617274436f6e73756d65720a460a0870726f64756365721000100110001001100010021003100010021000100110001003100010001a0d737461727450726f64756365721a01611a01621a0770726f636573730a460a08636f6e73756d65721000100110001001100310001002100010021000100110001000100310001a0d7374617274436f6e73756d65721a01611a01621a0770726f6365737312140a04726f6f741003180118011802180218031803180018011802`
 
let w = Stbx.decode_wiring(whex)
console.log(JSON.stringify(w))
console.log(Stbx.encode_wiring(w))
</script>

Examples (same for browser/node)

See @wires/stbx-core-js

Development

Running npm run bundle:production produces dist/stbx.min.js which can be used in the browser.

Run npm publish to publish the bundled package.

the unpkg field in package.json specifies which file is served when you surf to

must set NPM_AUTH_TOKEN on travis ci