api.md 7.4 KB

data-man Public API

A data manager, allowing you to attach various types of data and get it back in various other types

API documentation automatically generated by docmeteor.

-

new DataMan(data, [type])  Client

Arguments

  • data {File|Blob|ArrayBuffer|Uint8Array|String}

The data that you want to manipulate.

  • type {String} (Optional)

The data content (MIME) type, if known. Required if the first argument is an ArrayBuffer, Uint8Array, or URL

DataMan = function DataMan(data, type) { ... client/data-man-api.js:8

-

dataman.getBlob(callback)  Client

This method getBlob is defined in prototype of DataMan

Arguments

  • callback {Function}

callback(error, blob)

Returns {undefined}

Passes a Blob representing this data to a callback.

DataMan.prototype.getBlob = function dataManGetBlob(callback) { ... client/data-man-api.js:52

-

dataman.getBinary([start], [end], callback)  Client

This method getBinary is defined in prototype of DataMan

Arguments

  • start {Number} (Optional)

First byte position to read.

  • end {Number} (Optional)

Last byte position to read.

  • callback {Function}

callback(error, binaryData)

Returns {undefined}

Passes a Uint8Array representing this data to a callback.

DataMan.prototype.getBinary = function dataManGetBinary(start, end, callback) { ... client/data-man-api.js:84

-

dataman.saveAs([filename])  Client

This method saveAs is defined in prototype of DataMan

Arguments

  • filename {String} (Optional)

Returns {undefined}

Tells the browser to save the data like a normal downloaded file, using the provided filename.

DataMan.prototype.saveAs = function dataManSaveAs(filename) { ... client/data-man-api.js:146

-

dataman.getDataUri(callback)  Client

This method getDataUri is defined in prototype of DataMan

Arguments

  • callback {function}

callback(err, dataUri)

DataMan.prototype.getDataUri = function dataManGetDataUri(callback) { ... client/data-man-api.js:166

-

dataman.type()  Client

This method type is defined in prototype of DataMan

Returns the type of the data.

DataMan.prototype.type = function dataManType() { ... client/data-man-api.js:227

-

new DataMan(data, [type])  Server

Arguments

  • data {Buffer|ArrayBuffer|Uint8Array|String}

The data that you want to manipulate.

  • type {String} (Optional)

The data content (MIME) type, if known. Required if the first argument is a Buffer, ArrayBuffer, Uint8Array, or URL

DataMan = function DataMan(data, type) { ... server/data-man-api.js:10

-

dataman.getBuffer([callback])  Server

This method getBuffer is defined in prototype of DataMan

Arguments

  • callback {function} (Optional)

callback(err, buffer)

Returns {Buffer|undefined}

Returns a Buffer representing this data, or passes the Buffer to a callback.

DataMan.prototype.getBuffer = function dataManGetBuffer(callback) { ... server/data-man-api.js:54

-

dataman.saveToFile()  Server

This method saveToFile is defined in prototype of DataMan

Returns {undefined}

Saves this data to a filepath on the local filesystem.

DataMan.prototype.saveToFile = function dataManSaveToFile(filePath) { ... server/data-man-api.js:66

-

dataman.getDataUri([callback])  Server

This method getDataUri is defined in prototype of DataMan

Arguments

  • callback {function} (Optional)

callback(err, dataUri)

If no callback, returns the data URI.

DataMan.prototype.getDataUri = function dataManGetDataUri(callback) { ... server/data-man-api.js:84

-

dataman.createReadStream()  Server

This method createReadStream is defined in prototype of DataMan

Returns a read stream for the data.

DataMan.prototype.createReadStream = function dataManCreateReadStream() { ... server/data-man-api.js:95

-

dataman.size([callback])  Server

This method size is defined in prototype of DataMan

Arguments

  • callback {function} (Optional)

callback(err, size)

If no callback, returns the size in bytes of the data.

DataMan.prototype.size = function dataManSize(callback) { ... server/data-man-api.js:106

-

dataman.type()  Server

This method type is defined in prototype of DataMan

Returns the type of the data.

DataMan.prototype.type = function dataManType() { ... server/data-man-api.js:117

-

new dataman.Buffer(buffer, type)  Server

This method Buffer is defined in DataMan

Arguments

  • buffer {Buffer}
  • type {String}

The data content (MIME) type.

DataMan.Buffer = function DataManBuffer(buffer, type) { ... server/data-man-buffer.js:10

-

new dataman.DataURI(dataUri)  Server

This method DataURI is defined in DataMan

Arguments

  • dataUri {String}

DataMan.DataURI = function DataManDataURI(dataUri) { ... server/data-man-datauri.js:7

-

new dataman.FilePath(filepath, [type])  Server

This method FilePath is defined in DataMan

Arguments

  • filepath {String}
  • type {String} (Optional)

The data content (MIME) type. Will lookup from file if not passed.

DataMan.FilePath = function DataManFilePath(filepath, type) { ... server/data-man-filepath.js:11

-

new dataman.URL(url, type)  Server

This method URL is defined in DataMan

Arguments

  • url {String}
  • type {String}

The data content (MIME) type.

DataMan.URL = function DataManURL(url, type) { ... server/data-man-url.js:10