New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

pgerd-to-drawio-diagram-converter

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pgerd-to-drawio-diagram-converter

![hero.jpg](images%2Fhero.jpg)

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
13
increased by8.33%
Maintainers
1
Weekly downloads
 
Created
Source

pgerd-to-drawio-diagram-converter

hero.jpg

Try it out on: https://bertyhell.github.io/pgerd-to-drawio-diagram-converter

manual.jpg

Programmatic interface

Installation:

npm install pgerd-to-drawio-diagram-converter

Use inside node:

import {convertPgerdToDrawIo} from 'pgerd-to-drawio-diagram-converter';
import * as fs from "fs";

// Read the pgerd file as a string
const pgerdJsonString = fs.readFileSync('./diagram.pgerd').toString('utf-8');

// Interpret the string as json
const pgerdJson = JSON.parse(pgerdJsonString);

// Convert the json diagram info to a draw io xml format
const drawIoXmlString = convertPgerdToDrawIo(pgerdJson);

// Write the xml string to an xml file
fs.writeFileSync('./diagram.drawio.xml', drawIoXmlString);

Use inside a browser:

import { saveAs } from 'file-saver';

const pgerdDiagramJson: PgErdDiagramInfo = JSON.parse(pgerdJsonString);
const drawIoXml = convertPgerdToDrawIo(pgerdDiagramJson);

const blob = new Blob([drawIoXml], { type: 'text/xml;charset=utf-8' });
saveAs(blob, 'diagram.drawio.xml');

React example:

App.tsx

FAQs

Package last updated on 26 Mar 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc