title: How to create android keystore file using child_process in nodejs
body: <p>I wish to create a keystore file for my app using nodejs Child_process in express. From a accepted answer link, i tried including the below code in .ts. </p>
  
  <pre><code>    var filename:string = "checking";
      var ktArgs = ["-genkey", "-v", "-keystore", filename+".keystore", "-alias", filename, "-keyalg", "RSA", "-keysize" ,"2048", "-validity", "1"];
      var cmd = spawn('cmd',['/c', 'keytool'],ktArgs);
      cmd.stdout.on('data', function (data) {
          console.log('stdout: ' + data);
      });
     cmd.stderr.setEncoding('utf8');
      cmd.stderr.on('data', data =&gt; {
          cmd.stdin.write("password\n");
          console.log("Server stderr: ", data.toString());
      });
      cmd.stdout.on('data', data =&gt; {
          console.log("Server/myBuild/check: stdout:", data.toString());
      });
      cmd.on('close', code =&gt; {
          console.log('child process exited with code ' + code);
      });
  </code></pre>
  
  <p>On executing, i could see the child process exiting with code 0 and stderr on terminal screen. My keystore file is not generated. Please help me on how to create the keystore file and how to send my input data to the keystore questions using nodejs.</p>