Guest User

Untitled

a guest
Jun 23rd, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. const jsBeautify = require('js-beautify').js;
  2. const fs = require('fs');
  3. const glob = require('glob')
  4.  
  5. const options = {
  6. indent_size: 2,
  7. indent_char: ' ',
  8. indent_with_tabs: true,
  9. eol: '\n',
  10. end_with_newline: true,
  11. indent_level: 0,
  12. preserve_newlines: true,
  13. max_preserve_newlines: 10,
  14. space_in_paren: false,
  15. space_before_arguments :false,
  16. space_in_empty_paren: false,
  17. jslint_happy: false,
  18. space_after_anon_function: false,
  19. brace_style: 'collapse',
  20. break_chained_methods: true,
  21. keep_array_indentation: false,
  22. unescape_strings: false,
  23. wrap_line_length: 0,
  24. e4x: false,
  25. comma_first: false,
  26. operator_position: 'before-newline',
  27. space_before_conditional: false
  28. };
  29. // !(node_modules)/*.js
  30. glob('failed-message-checker.js', { absolute: true }, (er, files) => {
  31. files.forEach(file => {
  32. console.log(`js-beautify ${file}`);
  33. const data = fs.readFileSync(file, 'utf8');
  34. const nextData = jsBeautify(data, options);
  35. fs.writeFileSync(file, nextData, 'utf8');
  36. });
  37. });
Add Comment
Please, Sign In to add comment