FunkyJSON is an extension of JSON that allows for the transferring of functions and Regular Expressionsvia JSON.
FunkyJSON (FJSON) is an extension of the JSON that allows for the transmission of functions via JSON. The need to serialize functions into JSON was necessary to solve certains issues we were having so we developed a mean to serialize functions and parse them. FJSON is a very simple library.
FJSON takes a function and converts into a serializable object. For example, assume the object:
Would be converted to the following serializable object:
Install via NPM easily with
npm install fjson or globally with
npm install -g fjson
Once installed require in your code file easily:
var FJSON = require("fjson");
From here you can use the variable you stored the library into (in the above example it's
FJSON) or you
can use the same functions on the JSON object.
FJSON.funkify(obj); to serialize the object as a string (including functions) and use
FJSON.unfunkify(str); to convert a FJSON string into an object.
FJSON should be usable in a browser but this is untested.
Brandon Buck firstname.lastname@example.org
This software is licensed under the Affero General Public License which can be found here.