Skip to content

Instantly share code, notes, and snippets.

@soheilpro soheilpro/example
Created Jul 12, 2015

Embed
What would you like to do?
Convert JavaScript object to JSON
echo '{name: "soheil", age: 123}' | tojson
# Output:
# {"name":"soheil","age":123}
#!/usr/bin/env sh
read DATA
node -p "JSON.stringify($DATA)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.