Wynn Netherland changelog.com/posts

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]


Discussion

Sign in or Join to comment or subscribe

Player art
  0:00 / 0:00