fusebox: A safer way to monkey-patch JavaScript?

A standalone version of FuseJS’s fuse.Fusebox(), fusebox provides a sandbox to extend native JavaScript types without worrying about collisions with third-party libraries and scripts.

Example from the README:

var fb = Fusebox();
fb.Array.prototype.hai = function() {
  return fb.String("Oh hai, we have " + this.length + " items.");
};

fb.Array(1, 2, 3).hai(); // "Oh hai, we have 3 items."
typeof window.Array.prototype.hai; // undefined

Supported types include Array, Date, Function, Number, Object, RegExp, and String.

[Source on GitHub] [Introductory screencast]

News Films

Our little film studio focuses on telling developer-centric stories that need to be seen.

Beyond Code: Season 3 / GopherCon 2015

 
0:00 / 0:00