Any way to use in memory, without writing to a file?
See original GitHub issueI would like to be able to do something like:
const minify = require('@node-minify/core');
const html = `
<!doctype html>
<html ${htmlAttributes}>
<head>
<meta charset="utf-8">
<!-- ... -->
</head>
</html>
`
console.log(minify(html))
Although on all the examples I see you have to pass in a file and output a file. Is it possible to do it in memory like above?
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Reading then writing to a file without using memory (in place ...
I am aware that I can use buffers and reuse memory to minimize memory consumption, then use fseek -> Read -> Write till...
Read more >13. Files — How to Think Like a Computer Scientist
To use a notebook, it has to be opened. When done, it has to be closed. While the notebook is open, it can...
Read more >Reading, Writing, and Creating Files (The Java™ Tutorials ...
You can use the newBufferedWriter(Path, Charset, OpenOption...) method to write to a file using a BufferedWriter . The following code snippet shows how...
Read more >writemem (Write Memory to File) - Windows drivers
The .writemem command writes a section of memory to a file. dbgcmd. Copy.
Read more >Performing Memory File I/O Operations - IBM
This chapter describes how to perform memory file I/O operations. LE/VSE C Run-Time supports files known as memory files. Memory files are temporary...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Good idea, I will see that 👍
It’s live in 5.1.0 You can use it like that:
You need to pass the compressor according the content (html, css, javascript). I will see if I can find a solution to detect content type and use defaults compressors.
You can also still pass options to the compressor.