Escape string

Escapes the input so it can be pasted into source code as a literal.

  • ID: escape-string
  • Category: Utils
  • Aliases: string literal, jsesc, quote

Arguments

ArgumentTypeDefaultConstraints
Escape leveloption"Special chars"Special chars, Everything, Minimal
Escape quoteoption"Single"Single, Double, Backtick
JSON compatiblebooleanfalse
ES6 compatiblebooleantrue
Uppercase hexbooleanfalse