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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@guardian-network/policy-intermediate-representation

v0.3.6

Published

Artifcts high level declaration language

Readme

IR translator to define Policy

DO NOT USE IN PRODUCTION.
This implementation is in early development. It has not been reviewed or audited. It is not suitable to be used in production. Expect bugs!

Intermediate representation (IR) is needed to create the layer of abstraction between high-level policy constructors and the code that represents the policy onchain. IR can be perseived as an interface between human-readable code, GUI constructors - all sorts of tools convenient to humans, and object model of a policy that is used only by onchain code. IR is not ment neither to be written by humans nor to be read or debugged by them. It's an unambigous notation for policy-constructing translator.

The notation consists of an instance definitions, each written in a new line. The instance definition consists of three clauses, following each other, separated with spaces. Here they are:

  1. Artifact clause
    Defines an address of the target artifact of an instance. Denoted with curvy braces {} with a single value inside.

{0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48}

  1. Execution arguments clause
    Declares all the needed data, passed to the artifact's exec method. All arguments are enclosed into parenthesis () and divided with comma ,.
    Constants are written as is - strings are doublequoted, bytes and addresses must have 0x prefix.
    Variables are listed by names with mandatory prefix var. E.g. var bool myValuevarmyValue.
    Also, postfix $"<injection>" is appended to all variables. If the variable is injected, injection attribute is pasted instead of <injection>.
    Substitutions are referenced by nodeId inside verical bars ||.

(varMyNumber$"", varInjected$"my_attr", 1234, 0xe983fD1798689eee00c0Fb77e79B8f372DF41060, |0x0d68bc8fa0092f4020226d6cf49843553da6de839c908e4220723149ee39a11e|)

  1. Initialization arguments clause
    Optional block. Declares all the needed data, passed to the artifact's init method. Can be empty or absent.
    All arguments are enclosed into parenthesis <> and divided with comma ,.
    Arguments must be constants.

<1234, "init_me", true, 0x31621c02470F4e9e71428e209EfC97c07cdc64A3>

Overall, valid IR looks like this:

{0x6768008f6c2Ac94F9D65533D13A974b376495c7b} (1,"lang","here I am") <0,0xdeadbeef,true>
 {0xB60B02062d1256A79C81A061a9277e84ffbB0Ff7} (|0x7ce384eae0aa9f573819ad8aaa6a4eec71d9079f031feee34d51343934131dfe|,0xD9e88d1d18d8Cf3a17e97af9F017Ef8760dee583,varboolVar$"is_dev",0xdeadbeef,|0x7ce384eae0aa9f573819ad8aaa6a4eec71d9079f031feee34d51343934131dfe|,true) <>
{0xB60B02062d1256A79C81A061a9277e84ffbB0Ff7} (|0x7ce384eae0aa9f573819ad8aaa6a4eec71d9079f031feee34d51343934131dfe|,|0x5487fd7ba958bc80cdcaf554b244cb54db0a2def3d506dbbaf0b9d6956f3e825|) <"initialize me",0xd00d,0xB60B02062d1256A79C81A061a9277e84ffbB0Ff7>
{0x4838B106FCe9647Bdf1E7877BF73cE8B0BAD5f97} (|0xcb329f0b2f36e169bcdfee34b756614933b5255d462873e07fe749690e77223a|)

The root node is not passed via IR - it is ment to be set by other means as a separate meta-argument.