Jump To:

  1. utils/file-save.FileSave
    1. new exports.FileSave(data, options)
    2. fileSave.destroy()
    3. fileSave.getUrl()
    4. fileSave.createLink(text)
    5. FileSave.isBrowserSupported()
  2. utils/file-save~FileSaveOptions : Object

utils/file-save

utils/file-save.FileSave

Simple script that is useful for testing

  • Make a file
  • Create a URL to it
  • Gives utility function to create a link to the file (for front end)
  • Gives method to destroy the file when no longer needed
  • User can redefine the program by passing options object matching props.
    Limited to new browsers that support Blob(), also user preferences or type of browser may limit access to Blob functionality

Kind: static class of utils/file-save

new exports.FileSave(data, options)

Param Type Description
data * Data to put in blob file
options FileSaveOptions Options for file, see defaults (ie. type, filename)

fileSave.destroy()

Remove the blob url

Kind: instance method of FileSave

fileSave.getUrl()

Get the blob url

Kind: instance method of FileSave

fileSave.createLink(text)

Create link element with blob as href

Kind: instance method of FileSave

Param Type Description
text String The text to put in the link

FileSave.isBrowserSupported()

Check for Compatibility (optional, implement on user side)

Kind: static method of FileSave

utils/file-save~FileSaveOptions : Object

Options

Kind: inner typedef of utils/file-save
Properties

Name Type Description
filename String Filename for blob when creating a link (ie createLink) [default "filesave-file.txt"]
type String Filename for blob when creating a link (ie createLink) [default "text/plain;charset=utf-8"]