This course shows you how JavaScript programs import modules, take command-line arguments, and work with files. Imports, arguments and files all have JavaScript counterparts, but a few of the differences fail quietly.
Your project is a school site manager’s Python tool for the weekly boiler log, and you’ll port it to JavaScript. Here’s a first taste. The Python script takes the log’s name and the limit from the command line, and prints both. These are its first lines:
import sys
def main():
path = sys.argv[1]
threshold = float(sys.argv[2])
print(f"Checking {path} against {threshold}")
if __name__ == "__main__":
main()
Run as python digest.py logs/week-44.log 75, it prints this:
Checking logs/week-44.log against 75.0