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

erebus

v1.0.0-beta.3

Published

Schema-based seeded random data generation

Downloads

5

Readme

Erebus

Erebus is a data generation tool that:

  1. is based on schema files, so changing the structure of the data is easy
  2. is seeded, so it will always generate the same data as long as the seed remains constant*
  3. can generate extremely interconnected data to better simulate real situations
  4. can use different "flavors" of data, so you can pull names from Lord of the Rings, for example.

* note: changing the schemas will also (naturally) change the data generated.

How to use

This is kind of a weird thing to document. I'll do my best below, but you'll probably get a better feel for it by reading the tutorial.

npm install -g erebus

It takes several options, all of which can instead be put into an erebus.json file, if you prefer. Or whatever filename you pass with --config.

schemaDir (short: -i, default: ./schemas)

The directory where your schema files reside.

outputDir (short: -o, default: ./data)

The directory where the generated data will be written.

flavor (short: -f)

The dataset(s) from which to pull values when generating. You can declare multiple sources, for example

$ erebus -f asoiaf -f lotr

fallback (short: -F)

Make flavor selection fallback rather than merge (the default). Using the above example,

$ erebus -F -f asoiaf -f lotr

Erebus will first try to find a value in the asoiaf dataset, and only if that dataset lacks a generator for the requested value will it look at lotr.

verbose (short: -v)

Increase the verbosity. Only errors/warnings by default, -v includes some info, and -vv will spit out entirely too much.

seed (short: -s)

The seed to use when generating data. Can be a number or a string.

Schema format

Schema files should be objects, even if the data to generate is an array. The actual schema is a property of the object.

  • __generated__ - indicates that this file is one Erebus ought to parse. Otherwise it will be treated as a static datafile.
  • type - "Array" if this should generate an array of data, otherwise leave it out
  • count - [min, max] range of entries to generate
  • relatedData - an object, where each key is an alias to use, and each value is another object. The other object has:
    • use - the name of the schema to which this alias refers
    • count - another [min, max] type thing
    • backRef - key/value pairs for references to put into the use-schema-generated data. The value is the current objects own properties.
  • schema - the actual schema. The keys are the real keys that will be used in the output, the values can be. If a value begins with "$", then it will look up that value in the datasets. If a value begins with "@", then it is a cross-reference, and it will look it up per relatedData (above).

Check the example schemas in the repo.

Why "Erebus"?

Something chaos something random generation blah blah whatever. No real reason.