Condense JSON encoder/decoder for bandwidth efficiency
JSON is quickly becoming the formatting standard of choice for quick, convenient, and reliable machine to machine communications. It is flexible and widely supported but it has some drawbacks when it comes to data payloads like those from databases. A JSON payload from a database table named fruitsfruits
might look like this:
I've written the JavaScript JSON encoder/decoder below that uses the built-in JSON methods but is designed to recognize the 'C' at the beginning of the data and act appropriately. The methods are named the same as the built-in methods so to implement you would just have to do a find replace JSON for CJSON.
I'm looking for answersI've written the JavaScript JSON encoder/decoder below that offer advice on makinguses the code exception safe,built-in JSON methods but is designed to recognize the 'C
' at the beginning of the data and best practicesact appropriately. The methods are named the same as the built-in methods, so to implement you would just have to do a "find-replace" JSON for CJSON.
I'm looking for answers that offer advice on making the code exception safe, and best practices. If you need more details or examples you can view the project's GitHub page.
Edit: This post is attracting stackoverflow type responses instead of the review of the code I was looking for. To address that I posted a stackoverflow question as well.
Condense JSON for bandwidth efficiency
JSON is quickly becoming the formatting standard of choice for quick, convenient, and reliable machine to machine communications. It is flexible and widely supported but it has some drawbacks when it comes to data payloads like those from databases. A JSON payload from a database table named fruits might look like this:
I've written the JavaScript JSON encoder/decoder below that uses the built-in JSON methods but is designed to recognize the 'C' at the beginning of the data and act appropriately. The methods are named the same as the built-in methods so to implement you would just have to do a find replace JSON for CJSON.
I'm looking for answers that offer advice on making the code exception safe, and best practices.
If you need more details or examples you can view the project's GitHub page.
Edit: This post is attracting stackoverflow type responses instead of the review of the code I was looking for. To address that I posted a stackoverflow question as well.
JSON encoder/decoder for bandwidth efficiency
JSON is quickly becoming the formatting standard of choice for quick, convenient, and reliable machine to machine communications. It is flexible and widely supported but it has some drawbacks when it comes to data payloads like those from databases. A JSON payload from a database table named fruits
might look like this:
I've written the JavaScript JSON encoder/decoder below that uses the built-in JSON methods but is designed to recognize the 'C
' at the beginning of the data and act appropriately. The methods are named the same as the built-in methods, so to implement you would just have to do a "find-replace" JSON for CJSON.
I'm looking for answers that offer advice on making the code exception safe, and best practices. If you need more details or examples you can view the project's GitHub page.
Edit: This post is attracting stackoverflow type responses instead of the review of the code I was looking for. To address that I posted a stackoverflow question stackoverflow question as well.
Edit: This post is attracting stackoverflow type responses instead of the review of the code I was looking for. To address that I posted a stackoverflow question as well.
Edit: This post is attracting stackoverflow type responses instead of the review of the code I was looking for. To address that I posted a stackoverflow question as well.
Edit: This post is attracting stackoverflow type responses instead of the review of the code I was looking for. To address that I posted a stackoverflow question as well.
Edit: This post is attracting stackoverflow type responses instead of the review of the code I was looking for. To address that I posted a stackoverflow question as well.