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

nv-state-basic

v1.0.3

Published

nv-state-basic ======================== - nv-state-basic for nest-state-machine-definition mgmt

Downloads

1

Readme

nv-state-basic

  • nv-state-basic for nest-state-machine-definition mgmt

install

  • npm install nv-state-basic

usage

const {load_from_json} = require("nv-state-basic");

example

    var STATE = [
       'pending',
       'settled', [
           'resolved',
           'rejected'
       ]
    ]



    var rt = load_from_json('promise',STATE)
    > rt
    State [
    promise
        pending
        settled
            resolved
            rejected
    ] {
      T: 'promise',
      A: {}
    }



    > rt.nmap()
    {
      '0': 'promise',
      '1': 'promise/pending',
      '2': 'promise/settled',
      '3': 'promise/settled/resolved',
      '4': 'promise/settled/rejected',
      promise: 0,
      'promise/pending': 1,
      'promise/settled': 2,
      'promise/settled/resolved': 3,
      'promise/settled/rejected': 4
    }
    > rt.json()
    [ 'pending', 'settled', [ 'resolved', 'rejected' ] ]
    >




    > rt.$fstch_
    State [
        pending
    ] { T: 'pending', A: {} }
    >
    > rt.pending
    State [
        pending
    ] { T: 'pending', A: {} }
    >
    > rt
    State [
    promise
        pending
        settled
            resolved
            rejected
    ] {
      T: 'promise',
      A: {}
    }
    > rt.pending
    State [
        pending
    ] { T: 'pending', A: {} }
    >
    > rt.settled
    State [
        settled
            resolved
            rejected
    ] {
      T: 'settled',
      A: {}
    }
    > rt.settled.resolved
    State [
            resolved
    ] { T: 'resolved', A: {} }
    >
    > rt.settled.resolved.$parent_
    State [
        settled
            resolved
            rejected
    ] {
      T: 'settled',
      A: {}
    }
    >

    > rt.settled.resolved.pl_
    [ 'promise', 'settled', 'resolved' ]
    >
    > rt.settled.resolved.path_
    'promise/settled/resolved'
    >

    var STATE = [
       'ready',
       'pending',
       'settled', [
           'resolved',
           'rejected'
       ],
       'stopped',[
           'paused',
           'impossible'
       ]
    ]

    var rt = load_from_json('event',STATE)
    


    > rt.slct_
    rt.slct_impossible  rt.slct_paused      rt.slct_pending     rt.slct_ready       rt.slct_rejected
    rt.slct_resolved

    rt.slct_rejected()
    > rt
    State [
    event
        ready
        pending
        settled
            resolved
            rejected
        stopped
            paused
            impossible
    ] {
      T: 'event',
      A: {},
      curr_: 'rejected'
    }
    
    >rt.is_
    rt.is_impossible  rt.is_paused      rt.is_pending     rt.is_ready       rt.is_rejected    rt.is_resolved
    rt.is_settled     rt.is_stopped
    
    > rt.is_settled()
    true
    > rt.is_rejected()
    true
    > rt.is_resolved()
    false
    > rt.is_stopped()
    false
    > rt.is_pending()
    false
    > rt.is_ready()
    false
    >
    > rt.slct_resolved()
    undefined
    > rt
    State [
    event
        ready
        pending
        settled
            resolved
            rejected
        stopped
            paused
            impossible
    ] {
      T: 'event',
      A: {},
      curr_: 'resolved'
    }
    > rt.is_settled()
    true
    > rt.is_resolved()
    true
    > rt.is_rejected()
    false
    >

METHODS

API

  • load_from_json(j)

LICENSE

  • ISC