Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Restore **original** String prototype #41

lamuertepeluda opened this Issue · 0 comments

2 participants



I have some huge modules that relie on the JS Standard String prototype functions which conflict with the modification made by colors.js, such as String.bold() and are called by a module which uses colors.js to display colored output on the console.

A typical error I get is:

Property 'bold' of object my string  is not a function

Using mode = "browser" does not solve my problems because if I have a string var called x, I'd have to change all code to use x.bold inspite of x.bold().

This has also portability issues.

How can I completely restore the original String prototype only within this module?

Thanks in advance

@Marak Marak closed this
@tallesl tallesl referenced this issue in tallesl/format-unicorn

Please don't mutate String.prototype #1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.