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

@runtimeterror/rt-lib

v1.4.0

Published

Library for generating architecture diagrams from YAML files.

Downloads

21

Readme

rt-lib

pipeline status

Contributing

To get started, install packages with

$ npm install

Before submitting a merge request, please make sure all tests are passing and there are no linting errors.

Test

To execute the test suite, run:

$ npm test

Lint

For linting, we are following the AirBnB JavaScript Style Guide. To execute the linter run:

$ npm run lint

Publish

Publishing to the NPM registry is done manually, due to limitations of the free GitLab CI. To deploy a new version do the following:

  1. Create a new branch from most current master branch.
  2. In the root directory use the following to bump the version number:
$ npm version patch

OR

$ npm version minor

OR

$ npm version major
  1. Merge the newly created branch into master and wait for pipelines to pass. **Note: use the --tags flag when pushing to the remote repo to push the tags associated with the version bump.
  2. Pull down master.
  3. Compile typescript to javascript:
$ npx tsc
  1. Login to the NPM repository using:
$ npm login
  1. Publish to the NPM repository using:
$ npm publish

Definition for YAML Input File

Global Constraints

The name of every element described in the YAML must be unique.

Component

A self contained piece of a system that interacts with other pieces of that system.

Contents

  • name
    • String
    • unique
  • type
    • String
    • component
  • description (optional)
    • String
    • A description of the component.
  • relationships (optional)
    • List of strings
    • Each list item is a reference by name to a relationship that the component has to another component.
  • children (optional)
    • List of strings
    • Each list item is a reference by name to a component that is a child of the component.
  • metadata (optional)
    • List of key-value pairs.
    • Each key-value pair in the list represents a piece of extra information that may be important to note about the component.

Constraints

  • The parent-child association between components cannot be cyclical.
    • I.e. Component A cannot have Component B as both an ancestor and a descendant.

Example

"Component A":
  type: component
  description: Component A constructs filbert flanges for use in flux capactors.
  relationships:
    - Filbert Flange Exchange
  children:
    - Component B
    - Component C
  metadata:
    "Number of Nodes": 12
    "Web Server": Running Ruby on Rails 5.1
    "Log File Location": /var/log/component_a

Child Component

A component that is a child to a parent component.

Contents

The same as a regular component with the following differences:

  • Cannot have the children element.
  • parent (mandatory)
    • The component that references the child component in it's children field.
Constraints
  • As of right now, we only support one level of nested components. Thus, a component may not have a parent field if the component referenced by that parent field also has a parent field.
Example
"Component B":
  type: component
  description: Component B is the Filbert Flange Factory used by Component A.
  parent: Component A

Relationship

A directed connection between two components.

Contents

  • name
    • String
    • A unique name.
  • type
    • String
    • relationship
  • description (optional)
    • String
    • A description of the relationship.
  • connections
    • An array of objects with the to and from keys indicating the nodes that the relationship originates and terminates from respectively.
  • metadata (optional)
    • List of key-value pairs.
    • Each key-value pair in the list represents a piece of extra information that may be important to note about the relationship.

Constraints

  • When a component is defined to have a relationship, that component must be referenced in the relationships from field, to field, or both.
    • I.e. For Component A to include Relationship A in it's definition, Relationship A must have either from: Component A or to: Component Ain it's definition.
  • Relationships can only exist between two top level components, or two components that share the same parent component.
    • I.e. A child of Component A cannot have a relationship to a child of Component B, or to Component B.
  • Defining a reflexive relationship, i.e. a relationship where both the from and to fields refer to the same component, is not allowed. This sort of information must be captured either in relationships amongst child components, or in the metadata of the component.

Example

"Filbert Flange Exchange":
  type: **relationship**
  description: Component A passes it's created Filbert Flanges to the Component D cluster.
  connections:
    - from: component A
      to: component D1
    - from: component A
      to: component D2
  metadata:
    protocol: https
    endpoint: component_d.com/filbert_flange_intake
    "rate limit": 500 requests / minute
    authentication: Basic

Use Case

Contents

  • name
    • String
    • A unique name.
  • type
    • String
    • use case
  • description (optional)
    • String
    • A description of the use case.
  • path
    • An ordered list of components and relationships that represent how data flows through the system for the use case.
  • metadata (optional)
    • List of key-value pairs.
    • Each key-value pair in the list represents a piece of extra information that may be important to note about the use case.

Constraints

  • The path is ordered and must represent a valid path through the system involving components and relationships.
    • You cannot connect two components with a relationship that does not involve both of those components.
    • You cannot have a component in the path that is unconnected to other components in the path via a valid relationship.
  • The path must only include top-level components and relationships, or only include components that share the same parent component and their relationships.

Example

"Export Filbert Flanges":
  type: usecase
  description: "send filbert flanges from Component A to Component D using the Filbert Flange Exchange"
  path:
    - Component A
    - Filbert Flange Exchange
    - Component D
  metadata:
    artifact: Filbert Flange
    actors:
      - Bill
      - Ted