Skip to content

Instantly share code, notes, and snippets.

@fraserxu
Created February 5, 2015 03:22
Show Gist options
  • Save fraserxu/c5a65a19f5f10a9c518d to your computer and use it in GitHub Desktop.
Save fraserxu/c5a65a19f5f10a9c518d to your computer and use it in GitHub Desktop.
svg pattern generator
var btoa = require('btoa')
var fs = require('fs')
var pattern = fs.readFileSync('test.svg', { encoding: 'utf-8'})
var b64 = btoa(pattern)
var b64 = "data:image/svg+xml;base64," + b64
console.log(b64)
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment