regexpu.1 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. .Dd September 1, 2014
  2. .Dt regexpu 1
  3. .Sh NAME
  4. .Nm regexpu
  5. .Nd transpile ES6 Unicode regular expressions to equivalent ES5
  6. .Sh SYNOPSIS
  7. .Nm
  8. .Op Fl -c | -code Ar snippet
  9. .br
  10. .Op Fl -f | -file Ar file
  11. .br
  12. .Op Fl v | -version
  13. .br
  14. .Op Fl h | -help
  15. .Sh DESCRIPTION
  16. .Nm
  17. transpiles ES6 Unicode regular expressions to equivalent ES5.
  18. .Sh OPTIONS
  19. .Bl -ohang -offset
  20. .It Sy "-c, --code <snippet>"
  21. Print a transpiled version of the given ES6 snippet.
  22. .It Sy "-f, --file <file>"
  23. Print a transpiled version of the given ES6 file.
  24. .It Sy "-v, --version"
  25. Print regexpu's version.
  26. .It Sy "-h, --help"
  27. Show the help screen.
  28. .El
  29. .Sh EXIT STATUS
  30. The
  31. .Nm regexpu
  32. utility exits with one of the following values:
  33. .Pp
  34. .Bl -tag -width flag -compact
  35. .It Li 0
  36. .Nm
  37. successfully transpiled the input and printed the result.
  38. .It Li 1
  39. .Nm
  40. wasn't instructed to transpile anything (for example, the
  41. .Ar --help
  42. flag was set); or, an error occurred.
  43. .El
  44. .Sh EXAMPLES
  45. .Bl -ohang -offset
  46. .It Sy "regexpu -f foo-es6.js > foo-es5.js"
  47. Transpile `foo-es6.js` to valid ES5 and save the result as `foo-es5.js`.
  48. .It Sy "regexpu -c 'var x = /foo.bar/u;'"
  49. Print the transpiled version of the given ES6 snippet.
  50. .It Sy "echo 'var x = /foo.bar/u;' | regexpu -c"
  51. Print the transpiled version of the ES6 snippet that gets piped in.
  52. .El
  53. .Sh BUGS
  54. regexpu's bug tracker is located at <https://github.com/mathiasbynens/regexpu/issues>.
  55. .Sh AUTHOR
  56. Mathias Bynens <https://mathiasbynens.be/>
  57. .Sh WWW
  58. <https://mths.be/regexpu>