Skip to content

Latest commit

 

History

History
31 lines (18 loc) · 593 Bytes

README.md

File metadata and controls

31 lines (18 loc) · 593 Bytes

hyperfile-input

get a file raw file into the browser

var hyperfile = require('hyperfile')

document.body.appendChild(hyperfile(function (buffer) {
  //called with a raw array-buffer whenever the user selects a file.
}))

or get the file as an dataurl. (useful for writing to a canvas)

var hyperfile = require('hyperfile')

document.body.appendChild(hyperfile.asDataURL(function (dataurl) {
  //called with a raw buffer whenever the user selects a file.
}))

This does not use a cb(err, data) signature, because it may callback multiple times.

License

MIT