Discussion on: What do you guys use for formatting strings in javascript?

nombrekeff profile image
Manolo Edge Author

Yes, It could be accomplished using template literals, although for the use case I needed it for, it was not enough, I needed to process each string segment separately and process it in some way, also needed something where I could easily enable and disable some part of the formatting (which we call transformers within strif)

For example:

  • To color specific segments of the log.
  • Enabling/disabling color.
  • Having multiple transformers per segment.
  • But most importantly to not add complexity for the user that is not needed.

But yes, for most cases I think template literals are good enough.