UNPKG

@leronixlabs/nanite

Version:

Base64 String to JSON converter.

17 lines (16 loc) 323 B
// src/index.ts function Base64ToJSON(Input) { return Buffer.from(Input, "base64").toString(); } function JSONToBase64(Input) { try { const content = JSON.parse(Input); return Buffer.from(JSON.stringify(content)).toString("base64"); } catch (e) { throw e; } } export { Base64ToJSON, JSONToBase64 };