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

@trystal/data-gen

v1.6.3

Published

Data generator, primarily for use in testing Trystal applications

Downloads

24

Readme

Trist

Site | Docs | Wiki | Code of Conduct | Twitter | Chat

Data-Gen

Generating test trists....

Generates test data for Trystal and associated applications testing, primarily (ok, 'only' for now) trist data.

The key is that simple strings can be used to develop complex trist structures.

This: buildChain('A.B..C') builds a trist chain that models a trist that looks like this:

<] NodeA
<]   NodeB
 ]     NodeC   

where ABC are ids of nodes, and A has a level of 0, B has a level of 1, C has a level of 2 etc. Each . in the spec represents a level of indentation.

Parentheses are used to show hidden nodes thus:

buildChain('A(.B)C) builds a chain that looks like this:

>] NodeA
 ]   (NodeB (hidden))
 ] NodeC   

Note that this does NOT attempt to build all possibities of complex trist structures, just enough to a large percentage of the vast majority of tests that we do with Trystal structures.

Naming nodes....

In order to keep the trist specs simple, the ids must be in one simple format. For those familiar with regex, the matching pattern is /[A-Z][0-9]*/ig
For everyone else, this matches one letter and zero or more digits so

   A, B, W0, Q99 

are valid ids in the trist spec, but

  AA, @A, _l are not

It is highly recommended to only use single letters A, B, C, W, X, Y when generating trists, in order to keep the specs easy to visualize and reason about for human beings.

The additional digits are allowed in order to support dumping trists that have nodes that have been generated programattically with in a trist, such as by pasting in some text that becomes multiple lines. The trist code can assign these new lines ids of X1, X2, etc., and we wanted to be able to dump those out to easily check that the trist was valid.

Which brings us to...

Dumping trists....

The corollary function is dump, takes a trist and turns it back into a spec so that it can easily be checked for validity, and to make it easy to develop checks on test results. So for example, a test might construct and use a chain thus:

   chain = buildChain("AB") 

The application code would then insert a node between A and B, perhaps with an id of 'X0' and at an indentation level of 3. We would then test for:

   dump(chain) === 'A...X0B'

where the ...X0 is the added node at level 3.

Levels

This technical note is only interesting if you care about the internals of trysts

Note that trysts internally specify levels relatively meaning relative to the node that comes before. The Specs do NOT operate this way. They are always specified as absolute levels, even if the node is hidden. So that means this:

   A.B..C 

Specifies A at level 0, B at level 1, and C at level 2, even though internally this would be represented as B at rlevel +1 (relative to A) and C at rlevel +1 (relative to B)

Payloads

This code is concerned with the abstract manipulations of tryst structures and not payloads, so in the test data payloads are represent as simple objects with just the single property (id) that is needed to make the node valid.

Other test modules will be made available for manipulating payload contents (see the @trystal/trystup) application.