Set of functions to read and write data in the file system.
load <pathToFile>
Command to read data from the file system. If the path is not absolute it will take it relative to the scripts folder. The content is read as string (utf8) or JSON.
Parameters:
- pathToFile: File to load
Examples:
# Load a JSON file from the scripts folder
payloadVcOnboard: load assets/VerifiableAuthorisationToOnboard.json
# Load a file with absolute path
data: load /path/to/config.json
Supported File Types:
- JSON files: Automatically parsed as JSON objects
- Text files: Loaded as UTF-8 strings
export <data> <pathToFile>
Command to write data in the file system. If the path is not absolute it will be relative to the current working directory.
Parameters:
- data: Data to export
- pathToFile: File to write the data
Examples:
# Export a public key to PEM format
export user.keys.ES256.publicKeyPem myKey.pem
# Export user data to JSON file
export user userData.json
# Export a JWT token to file
export token accessToken.jwt
# Export computed data
export computedResult result.json
Common Use Cases:
- Key Export: Save cryptographic keys for external use
- Data Backup: Export important data for backup purposes
- Integration: Export data for use in other applications
- Debugging: Export intermediate results for analysis