[](https://www.npmjs.com/package/fa-diagrams) [](https://travis-ci.org/Klemek/fa-diagrams) [](https://coveralls.io/github/Klemek/fa-diagrams?branch=master) # fa-diagrams **SVG diagrams built from Font-Awesome icons** **[Demo](https://klemek.github.io/fa-diagrams)** ## RoadMap to v1 * [x] Font-Awesome paths scrapping in build * [x] Node placing with links * [x] SVG output * [x] Node's icon rendering * [x] Simple links rendering * [x] Dashed links rendering * [x] Colors * [x] Sub-texts * [x] Font styles * [x] Sub-icons * [x] Unit testing * [ ] Examples ## Summary * [Usage](#usage) * [Node module](#node-module) * [Html script](#html-script) * [Install](#install) * [CDN](#cdn) * [Static scripts](#static-scripts) * [NPM](#npm) * [Build from sources](#build-from-sources) * [API](#api) * [`options`](#options) * [`nodes`](#nodes) * [`links`](#links) * [Sub-elements](#sub-elements) * [More info](#more-info) * [Icon names](#icon-names) * [Link types](#link-types) * [Thrown errors](#thrown-errors) * [Change icons](#change-icons) * [Examples](#examples) ## Usage *[back to top](#top)* ### Node module ```javascript const faDiagrams = require('fa-diagrams'); // data: sample const data = { "nodes": [ { "name": "node1", "icon": "laptop-code", "color": "#4E342E", "bottom": "my app" }, { "name": "node2", "icon": "globe", "color": "#455A64", "bottom": "world" } ], "links": [ { "from": "node1", "to": "node2", "color": "#333333", "top": { "icon": "envelope" }, "bottom": "\"hello\"" } ] } const svg = faDiagrams.compute(data); // string containing xml data //export as SVG with fs const fs = require('fs'); fs.writeFileSync('diagram.svg', svg, {encoding:'utf-8'}); //export as PNG with svg2img (npm i svg2img) const svg2img = require('svg2img'); svg2img(svg, function(error, buffer) { fs.writeFileSync('diagram.png', buffer); }); ``` Will produce the following diagram:  ### Html script ```html
... ... ... ...