0.0.1 • Published 6 years ago

@creenv/file-loader v0.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

@creenv/loader

A tiny file loader

import FileLoader from "@creenv/file-loader";

let file;

FileLoader("/path/to/my/file").then((filedata) => {
  file = filedata;
  console.log(filedata);
}).catch((err) => {
  console.error(err);
});

function Fileloader (filepath: string, responseType: *string)

argumenttypedefaultwhat for ?
filepathstringthe path to the file, relative to the script or to the server root depending on which case suits the best for you
responseTypestringthe type of response expected, cf: the type of the file requested. A list of valid responseType is available under the XHTML Media Types - Second Edition page.