Is there JSON encode/decode base64 encode/decode function in JavaScript?
JSON and base64 are completely independent.
Here's a JSON stringifier/parser (and direct GitHub link).
Here's a base64 Q&A. Here's another one.