// リスト4-11
const fs = require('fs');
const { prompt } = require('./mymodule.js');
async function main() {
	const msg = await prompt('please type:');
	try {
		fs.writeFileSync('./data.txt', msg);
		console.log('save data.txt to write:');
		console.log(msg);
	} catch (e) {
		console.error(e.message);
	}
}
main();