title: Create a file from user input Node.js
body: <p>So I'm making a discord bot, and I want to have a file called createcommand.js, so when you run it with node createcommand.js is starts asking for user input. So it ask &quot;what should the name be&quot; and then it creates a file from the input with the name, the it will ask &quot;what should it send&quot; and then  it will add the command in the file. I've tried with <code>https://pastebin.com/UARJcExh</code></p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>#!/usr/bin/env node
  const fs = require('file-system');
  const ncp = require('ncp');
  const init = async function () {
  const modulee = require('../index.js')
  const readline = require('readline').createInterface({
      input: process.stdin,
      output: process.stdout
    })
  const name =
        
        
  readline.question(`Welcome, what should the name of the command be?`, (input) =&gt;{
    js.name = input
    
   
  let config = {}
  
    readline.question(`What should it output`, (input) =&gt; {
      js.output = input;
      
    
      readline.close();
      
    })
  })
  }
  var js = `
          exports.run = async (client, message, args, level) =&gt; {
   message.channel.send(output)
  };
  
  exports.conf = {
    enabled: true,
    guildOnly: false,
    aliases: [],
    permLevel: "User"
  };
  
  exports.help = {
    name: "support",
    category: "Miscelaneous",
    description: "",
    usage: name
  };
      
  module.exports = config;`;
   fs.appendFile(`${js.name}`, js ,function (err) {
      if (err) {
        throw new Error(err);
      }})
  
  init();</code></pre>
  </div>
  </div>
  </p>
  <p>. But it doesn't work.</p>