Web Automation Processor
WAP (Web Automation Processor) is an automation module designed for different applications.

A WAP usually provides No-Code commands and Low-Code Editor


WAP provides commonly used synchronous functions under api
:
api.files()
– Returns a list of files in the working directory.api.read(filename, encoding='utf8')
– Reads the content of a file.api.write(filename, text)
– Writes text content to a file.api.rename(oldname, newname)
– Renames a file.api.remove(filename)
– Deletes a file.
Additionally, moment.js
and lodash
are built-in libraries and can be used directly.
// lists all files in the workspace, one by one.
api.files().forEach((file) => console.log(file))
// use lodash.js _.filter() function to filter files ending with ".jpg"
const files = api.files()
console.log(_.filter(files, (file) => file.endsWith('jpg')))
// read "price.txt"
console.log(api.read('price.txt'))
// format date string and write it to a text file
api.write('time.txt', moment().format('HH:mm:ss'))
// rename "time.txt" to "currentTime.txt"
api.rename('time.txt', 'currentTime.txt')
// delete "price.txt"
api.remove('price.txt')
Last updated