Skip to content

Instantly share code, notes, and snippets.

@fukaoi
Created April 23, 2019 12:50
Show Gist options
  • Save fukaoi/19e22e0e607e4c2b5512495a99f4fc97 to your computer and use it in GitHub Desktop.
Save fukaoi/19e22e0e607e4c2b5512495a99f4fc97 to your computer and use it in GitHub Desktop.
node.js to crystal named pipe
const exec = require('child_process').exec;
var obj = {
"name":"太郎",
"age": 30,
"area":"Tokyo"
}
const json = JSON.stringify(JSON.stringify( obj ));
console.log(json)
exec("echo " + json + " > ~/Work/hogepipe", function(err, stdout, stderr){
console.log(stdout)
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment