{"_id":"@artemkaint/dbml-renderer","name":"@artemkaint/dbml-renderer","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@artemkaint/dbml-renderer","version":"1.0.0","main":"./lib/api.js","types":"./lib/api.d.ts","bin":{"dbml-renderer":"lib/index.js"},"scripts":{"generate:parser":"peggy src/dbml.pegjs","format":"npx prettier --write src/ package.json","format:check":"npx prettier --check src/ package.json","build":"tsc","test":"ava"},"keywords":[],"author":"","license":"ISC","devDependencies":{"@types/node":"^18.15.11","@types/yargs":"^17.0.24","ava":"^5.2.0","peggy":"^3.0.2","prettier":"^2.8.7","prettier-plugin-organize-imports":"^3.2.2","ts-node":"^10.8.0","typescript":"^5.0.4"},"dependencies":{"@aduh95/viz.js":"3.4.0","yargs":"^17.7.1","zod":"^3.21.4"},"description":"[![npm version](https://img.shields.io/npm/v/@softwaretechnik/dbml-renderer)](https://www.npmjs.com/package/@softwaretechnik/dbml-renderer) [![.github/workflows/build.yml](https://github.com/softwaretechnik-berlin/dbml-renderer/actions/workflows/build.yml","ava":{"extensions":["ts"],"require":["ts-node/register"]},"_id":"@artemkaint/dbml-renderer@1.0.0","gitHead":"04dffeca183e066d8f4c1e0f380a0c299b01e95d","_nodeVersion":"20.11.1","_npmVersion":"10.5.0","dist":{"integrity":"sha512-jOYR2LjB9B2dmQ+SJFQ9K10NTxP5jnISKKJBWkZVF4OPx/SNY3LpySbngtuYVcMiAT1o68J1POnAS6CO7F8RnQ==","shasum":"8fab95f993e7389fbf47349074a47b220da60c22","tarball":"https://registry.npmjs.org/@artemkaint/dbml-renderer/-/dbml-renderer-1.0.0.tgz","fileCount":88,"unpackedSize":1078720,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCjzxWGBeGp5yJVUcQDe0SRuX7Myl/MfWxlhQ6GBTvCmgIhAONFtclGGSdQ3LBq8I21M77wgqp2t+5dkaWT3xxzsMlT"}]},"_npmUser":{"name":"artemkaint","email":"artemkaint@gmail.com"},"directories":{},"maintainers":[{"name":"artemkaint","email":"artemkaint@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dbml-renderer_1.0.0_1710147546229_0.7293379358022412"},"_hasShrinkwrap":false}},"time":{"created":"2024-03-11T08:59:06.137Z","1.0.0":"2024-03-11T08:59:06.387Z","modified":"2024-03-11T08:59:06.916Z"},"maintainers":[{"name":"artemkaint","email":"artemkaint@gmail.com"}],"description":"[![npm version](https://img.shields.io/npm/v/@softwaretechnik/dbml-renderer)](https://www.npmjs.com/package/@softwaretechnik/dbml-renderer) [![.github/workflows/build.yml](https://github.com/softwaretechnik-berlin/dbml-renderer/actions/workflows/build.yml","keywords":[],"license":"ISC","readme":"[![npm version](https://img.shields.io/npm/v/@softwaretechnik/dbml-renderer)](https://www.npmjs.com/package/@softwaretechnik/dbml-renderer) [![.github/workflows/build.yml](https://github.com/softwaretechnik-berlin/dbml-renderer/actions/workflows/build.yml/badge.svg)](https://github.com/softwaretechnik-berlin/dbml-renderer/actions/workflows/build.yml)\n\n`dbml-renderer` renders [DBML](https://www.dbml.org/home/) files to SVG images.\nIt provides a command line interface, so that you can easily use it in your\ndocumentation toolchain.\n\n## Command Line Usage\n\n```bash\nnpm install -g @softwaretechnik/dbml-renderer\n```\n\nIt can then be used to render DBML files like so:\n\n```bash\ndbml-renderer -i example.dbml -o output.svg\n```\n\nFor instance, the following input will produce the image below:\n\n```dbml\nTable users {\n    id integer\n    username varchar\n    role varchar\n    created_at timestamp\n}\n\nTable posts {\n    id integer [primary key]\n    title varchar\n    body text [note: 'Content of the post']\n    user_id integer\n    created_at timestamp\n}\n\nRef: posts.user_id > users.id\n```\n\n![Posts example output](examples/user-posts.dbml.svg)\n\nThe [examples directory](examples/) contains other input and output examples.\n\n## Testing\n\nThe tests can be run with `npm test`. They use the examples available in the\n`examples` directory. Each `.dbml` file is used as input to render each of the\navailable output formats.\n\nThe output of a test run is placed in `.test-output`. In case the renderer has\nbeen modified, the test output can be visually inspected and, confirmed the\noutput is good, the expectations can be updated by copying them with the\nfollowing command:\n\n```bash\ncp .test-output/* examples/\n```\n\nTo aid the visual inspection, you can open `.compare-test-output.html` to\ncompare side-by-side each generated SVG.\n","readmeFilename":"README.md"}