mirror of
https://github.com/theoludwig/programming-challenges.git
synced 2024-11-09 22:08:58 +01:00
17 lines
447 B
JavaScript
17 lines
447 B
JavaScript
|
const path = require('path')
|
||
|
const fs = require('fs').promises
|
||
|
const solution = require('./solution')
|
||
|
|
||
|
const inputPath = path.join(__dirname, 'input.json')
|
||
|
const outputPath = path.join(__dirname, 'output.json')
|
||
|
|
||
|
const main = async () => {
|
||
|
const inputFile = await fs.readFile(inputPath)
|
||
|
const inputJSON = JSON.parse(inputFile)
|
||
|
|
||
|
const result = solution.apply(null, inputJSON)
|
||
|
await fs.writeFile(outputPath, JSON.stringify(result))
|
||
|
}
|
||
|
|
||
|
main()
|