Suite.js Documentation

Introduction


Getting Started

• Downloading & Installing
• Running
Examples


Technical Support


Functions

Cryptography
• hashSHA256
• hmacSHA256
• hashSHA512
• hmacSHA512
• hashMD5
• hmacMD5

File System
fileExists
fileRead
fileWrite
folderExists
unzip
zip

Input / Output
beep
prompt
write
writeln

Networking
curlExecute
• nsapiExecute

Operating System
shellExecute

Text Encoding
base64Decode
base64Encode


Advanced Topics

zip

Compresses the specified file, and returns the path to the newly created zip file.

Supports three optional parameters:
contentsOnly. When True, and the path is actually to a folder, only the files in the folder are compressed (i.e. not the folder itself). Default is False.
compression. Indicates the type of compression to be used. Options are Best, Fast, None, and Normal. Default is Normal.
password. Used to password protect the resulting zip file. The password will be required to unzip the file.

zip Example

var filepath = info.sourceFile.parentNativePath + "/../examples/";

// Zip the folder using the "best" compression, and set "secret" as the password for the zip file.
var zipfilePath = zip( filepath, true, "best", "secret" );

if ( info.error.number != null ) {
	writeln( "ERROR: Unable to zip the file / folder." );
	writeln( "• Error Number: " + info.error.number );
	writeln( "• Message: " + info.error.message );
	quit;
}

writeln( "The zip file is located here:" );
writeln( zipfilePath );

© Copyright 2025 Tim Dietrich. | Legal Info