1.1.0 • Published 7 years ago

bird-flowchart-generator v1.1.0

Weekly downloads
-
License
GPL-3.0
Repository
-
Last release
7 years ago

bird-flowchart-generator

bird-flowchart-generator is a library that lets you transform this JSON:

[
    { name: "this package" },
    { bird: 1, name: "useful NPM packages" },
    { bird: 2, name: "JS community" },
    { bird: 3, name: "JS community" }
]

into this image: funny_meme

You can use it for example in Express endpoint:

const bird = require("bird-flowchart-generator")
const express = require('express')
const app = express()
app.get('/', (req, res) => {
	bird.generateBirdFlowchart([
	    { name: "this package" },
	    { bird: 1, name: "useful NPM packages" },
	    { bird: 2, name: "JS community" },
	    { bird: 3, name: "JS community" },
	], imgBuffor => {
	    res.writeHead(200, {
	    	'Content-Type': 'image/png',
	    	'Content-Length': imgBuffor.length
	    });
	    res.end(imgBuffor); 
	})	
});

or save your image to file:

const bird = require("bird-flowchart-generator")
const fs = require("fs")
bird.generateBirdFlowchart([
    { name: "Jquery" },
    { bird: 1, name: "Angular" },
    { bird: 2, name: "React" },
], buffer => {
    fs.writeFileSync("../birds.png", buffer)
})

btw. pls use Node 7+ because this lib uses quite a lot of async await.

1.1.0

7 years ago

1.0.0

7 years ago