dotpic

Doc picture generator

Usage no npm install needed!

<script type="module">
  import dotpic from 'https://cdn.skypack.dev/dotpic';
</script>

README

dotpic

Build Status Code Climate Code Coverage npm Version JS Standard

Doc picture generator

Installation

$ npm install dotpic --save

Usage

'use strict'

const dotpic = require('dotpic')
const fs = require('fs')

// Write dot picture
let src = `
000011110000
000001100000
000001100000
000001100000
100001100001
111111111111
111111111111
100001100001
000001100000
000001100000
000001100000
000001100000
000001100000
000001100000
000001100000
000001100000
000011110000
`

let svg = dotpic(src, {
  colors: {
    '0': '#444',
    '1': '#FFF'
  }
})

fs.writeFile('my-svg.svg', svg)

Signature

dotpic(src, options) -> string

Params

Name Type Description
src string image data
options Object Optional settings
options.colors Object Color data
options.width number Image width
options.height number Image height
options.background string Background color

License

This software is released under the MIT License.

Links