Skip to content

Instantly share code, notes, and snippets.

@AdityaChaudhary
Last active July 17, 2018 10:18
Show Gist options
  • Select an option

  • Save AdityaChaudhary/e50a52e806e172f6f159f5314eca468c to your computer and use it in GitHub Desktop.

Select an option

Save AdityaChaudhary/e50a52e806e172f6f159f5314eca468c to your computer and use it in GitHub Desktop.
Serialize a function in Node.js
var serialize = require('node-serialize');
x = {
test : function(){ return 'hi'; }
};
console.log("Serialized: \n" + serialize.serialize(x));
/*
"_$$ND_FUNC$$_function (){ return 'hi'; }()"
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment