0.5.2 • Published 3 years ago

@diagrams-ts/core v0.5.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

diagrams-ts/core

logo

The extracted core logic without usage of any NodeJS or Browser specific apis. Creating strings with dot language directly from code.

Installation and Requirements

For developing you'll need a node version >= 14.

Install this package by running:

npm install @diagrams-ts/core

# or when using yarn

yarn add @diagrams-ts/core

Getting started

Import the library, choose a provider, write your code and generate a dotstring.

main.ts:

import * as diagramsCore from "@diagrams-ts/core";
import { graph } from "@diagrams-ts/graphviz-functional-ts";

const {
  providers: {
    aws: {
      compute: { Lambda },
      storage: { S3 },
    },
  },
  diagram,
  initDiagram,
} = diagramsCore;

const awsFlow = () => {
  return diagram`${Lambda("My Lambda")}>>${S3("My Bucket")}`;
};

(async () => {
  try {
    const dotOutput = await initDiagram("My Example", "LR")(awsFlow);
    console.log(dotOutput);
  } catch (error) {
    console.log(error);
  }
})();

This will log the rendered dotOutput which you could pass directly to any tool/library that accepts dotstrings as input.

0.5.2

3 years ago

0.5.1

3 years ago

0.5.0

3 years ago

0.4.0

3 years ago

0.3.11

3 years ago

0.3.10

3 years ago

0.3.9

3 years ago

0.3.7

3 years ago

0.3.5

3 years ago

0.3.4

3 years ago

0.3.3

3 years ago

0.3.2

3 years ago

0.3.1

3 years ago

0.3.0

3 years ago