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

fileRead

Returns the content of a file at the specified location.

fileRead Example

// Specify the path to the file.
var filepath = info.sourceFile.parentNativePath + "/../";

// If the path (folder) doesn't exist...
if( ! folderExists( filepath ) ) {
	writeln( "ERROR: The folder (" + filepath + " does not exist." );	quit;
}

// Specify the filename.
var filename = "License.txt";

// If the file doesn't exist...
if( ! fileExists( filepath + filename ) ) {
	writeln( "ERROR: The file (" + ( filepath + filename ) + ") does not exist." );	quit;
}

// Read the file.
var fileContents = fileRead( filepath + filename );

if ( info.error.type != null ) {
	writeln( "ERROR: " + info.error.type );	
	quit;
}

writeln( 'File Contents:' );
writeln;
writeln( stringIndent( fileContents, 5 ) );
writeln;

© Copyright 2025 Tim Dietrich. | Legal Info