1.0.4 • Published 4 years ago

electronjsxp v1.0.4

Weekly downloads
2
License
ISC
Repository
github
Last release
4 years ago

Using

const electronjsxp = require("electronjsxp");

Commands => Download

electronjsxp.download(url, path, textid, onend);

URL - File URL

Path - Save Path

TextID - ID of text to show percentage of download

onEnd - Function to run when download is end

Example: electronjsxp.download("https://test.website/downloads/your_file.txt", "C:\Example\your_file.txt", "percentOfDownload");

Commands => File management

electronjsxp.json_write(data, path);

Data - JSON data (for more, read example)

Path - Save Path (end on .json!)

Example: electronjsxp.json_write({ "Example": "This is a test!" }, "C:\Example\your_file.json");

electronjsxp.json_read(path);

Path - Read from path

Example: var data = electronjsxp.json_read("C:\Example\your_file.json");

Example: console.log(data.Example);

Example - Result: This is a test!

electronjsxp.text_write(data, path);

Data - Text

Path - Save Path

Example: electronjsxp.text_write("This is a test!", "C:\Example\your_file.txt");

electronjsxp.text_read(path);

Path - Read from path

Example: var data = electronjsxp.text_read("C:\Example\your_file.txt");

Example: console.log(data);

Example - Result: This is a test!

electronjsxp.delete(path);

Path - File to remove

Example: electronjsxp.delete("C:\Example\your_file.txt");

Commands => HTML Arguments

electronjsxp.html_setattribute(id, attribute, value);

ID - ID of object to set attribute

Attribute - Attribute to set

Value - Value to set

Example: electronjsxp.html_setattribute("buttonToDownload", "disabled", "true");

electronjsxp.html_removeattribute(id, attribute);

ID - ID of object where remove argument

Attribute - Attribute to remove

Example: electronjsxp.html_removeattribute("buttonToDownload", "disabled");

electronjsxp.html_enableobject(id);

ID - ID of object to enable

Example: electronjsxp.html_enableobject("buttonToDownload");

electronjsxp.html_disableobject(id);

ID - ID of object to disable

Example: electronjsxp.html_disableobject("buttonToDownload");

Commands => Redirects

electronjsxp.redirect_noback(url);

Redirects without back button (so you can't go back with back button)

URL - URL to redirect

Example: elextronjsxp.redirect_noback("https://test.website/second.html");

electronjsxp.redirect(url);

Redirects with back button (so you can go back with back button)

URL - URL to redirect

Example: elextronjsxp.redirect("https://test.website/second.html");

Commands => App Managment

electronjsxp.getAppData();

Example: var data = electronjsxp.getAppData();

Example: console.log(data);

Example - Result: Name: Test Electron App, version: 1.0.2

electronjsxp.getAppPath();

Example: var data = electronjsxp.getAppPath();

Example: console.log(data);

Example - Result: C:\Example\TestApp.exe

electronjsxp.overridePath(path);

Path - Path to override

Example: electronjsxp.overridePath("C:\NotMyExampleFolder");

Commands => Other

electronjsxp.test();

Example: electronjsxp.test();

Example - Result: ElectronJSXP v.1.0.2 by StopperTech. Advanced Electron Tools

Example - Result: If you see this, ElectronJSXP is working fine!

electronjsxp.exit();

Exits from application.

Example: electronjsxp.exit();