https://github.com/flow-build/process-tree
https://github.com/flow-build/process-tree
Last synced: about 21 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/flow-build/process-tree
- Owner: flow-build
- License: mit
- Created: 2023-03-02T21:40:11.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-06T17:06:29.000Z (over 3 years ago)
- Last Synced: 2025-10-14T12:27:53.731Z (8 months ago)
- Language: TypeScript
- Size: 58.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Flowbuild Process Tree
A flowbuild extension to allow saving hierarchical relationship between processes.
## Gist
**Install**
``` $ npm install @flowbuild/process-tree ```
Add environment variables to configure db connection
KNEX_ENV: test | prod
PTREE_LOG_LEVEL: silly | debug | verbose | info | warn | error
POSTGRES_HOST
POSTGRES_USER
POSTGRES_PASSWORD
POSTGRES_PORT
POSTGRES_DATABASE
**Create a new tree**
```
import { Tree } from '@flowbuild/process-tree'
const tree = new Tree(db)
await tree.createTree(processId)
```
**Append a new node to existing tree**
```
await tree.appendChild({ parentId: uuid, processId: uuid })
```
**Retrieve the path**
Any process from the thee will return all process from that tree.
```
await tree.getPath(processId)
```