I'm working on a grunt build file which hits a URL and writes the output to a static HTML file. The url I'm hitting has compressed HTML and I'd like to pretty print it before writing to the static file. Are there any good modules for doing this? I've looked around and it seems like Max Ogden's html prettyprinter is my closest option (https://github.com/maxogden/commonjs-html-prettyprinter). Maybe if I combine it with the grunt-shell task or something? Really I'd prefer to just require a module in grunt and say pretty(my-file.html) and then write that using fs but so far that is proving elusive.
相关问题
- npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fs
- google-drive can't get push notifications
- Failed at the electron@1.8.2 postinstall script
- How to reimport module with ES6 import
- Webpack getting started, import error
相关文章
- node连接远程oracle报错
- How can make folder with Firebase Cloud Functions
- @angular-cli install fails with deprecated request
- node.js modify file data stream?
- How to resolve hostname to an ip address in node j
- Transactionally writing files in Node.js
- Log to node console or debug during webpack build
- Get file created date in node
You found all the resources you need. That module does it for you.
Look at it's source.
Or you could use child_process to execute the command found in the README:
html *.html
.