4be9b5adc9d8b16544389803fd22464ca2f0499ba1327c4175b7c9ea4f868fde334fe073a5a7f3a0fbbcbc1fef6be65e71ee34ba53c9da36b45a9582a81f29 788 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # RegJSParser
  2. Parsing the JavaScript's RegExp in JavaScript.
  3. ## Installation
  4. ```bash
  5. npm install regjsparser
  6. ```
  7. ## Usage
  8. ```js
  9. var parse = require('regjsparser').parse;
  10. var parseTree = parse('^a'); // /^a/
  11. console.log(parseTree);
  12. // Toggle on/off additional features:
  13. var parseTree = parse('^a', '', {
  14. // SEE: https://github.com/jviereck/regjsparser/pull/78
  15. unicodePropertyEscape: true,
  16. // SEE: https://github.com/jviereck/regjsparser/pull/83
  17. namedGroups: true,
  18. // SEE: https://github.com/jviereck/regjsparser/pull/89
  19. lookbehind: true
  20. });
  21. console.log(parseTree);
  22. ```
  23. ## Testing
  24. To run the tests, run the following command:
  25. ```bash
  26. npm test
  27. ```
  28. To create a new reference file, execute…
  29. ```bash
  30. node test/update-fixtures.js
  31. ```
  32. …from the repo top directory.