Skip to content
Transform stream to create a data uri
JavaScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.gitignore
README.md
index.js
package.json
test.js

README.md

data-uri-stream

Create a transform stream that will emit a data uri.

Usage

var datauri = require("data-uri-stream"),
    concat = require("concat-stream"),
    fs = require("fs");

    fs.readFile("image.png")
        .pipe(datauri({ type: "image/png" }))
        .pipe(concat(function(data) {
            console.log(data) // datauri
        });
Something went wrong with that request. Please try again.