jsesc

Given some data, jsesc returns the shortest possible stringified & ASCII-safe representation of that data.

cssesc

A JavaScript library for escaping CSS strings and identifiers while generating the shortest possible ASCII-only output.

regenerate

Generate JavaScript-compatible regular expressions based on a given set of Unicode symbols or code points.