macuploader

1.2.9 • Public • Published

Installation

This is a Node.js module available through the npm registry.

Before installing, download and install Node.js. Node.js 0.10 or higher is required.

If this is a brand new project, make sure to create a package.json first with the npm init command.

Installation is done using the npm install command:

Examples

Check Server Status

const status = await module.online("...url");
console.log(status); // true or false

Upload File

const file = await module.upload(stream, { server: "...url", token: "...apiToken", name: "...fileName" });
console.log(file); // returns file key in JSON object

Download File

const download = await module.download("..url");
const dest = fs.createWriteStream("...filePath");
download.pipe(dest);
download.on("end", () => {
    // When the file finishes downloading.
});

Package Sidebar

Install

npm i macuploader

Weekly Downloads

3

Version

1.2.9

License

ISC

Unpacked Size

3.26 kB

Total Files

4

Last publish

Collaborators

  • zeptooo
  • mactych