question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Proposal to allow files to pass through `dest` without writing them to disk.

See original GitHub issue

@jonschlinkert and I have been trying to figure out a way to pipe files through dest but not actually write the files to disk or create the directories.

The goal is to ensure the file properties are updated using the same logic from prepare-write, then use the properties in another stream plugin. Our specific use case is to create a directory tree from the destination file paths.

We’ve come up with this solution, which uses a file.writeFile property to skip creating the destination directory and return early in write-contents when set to false.

Will you accept a pull request with this change, or suggest another way we could accomplish the same thing?

Thanks.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:18 (15 by maintainers)

github_iconTop GitHub Comments

2reactions
phatedcommented, Jul 21, 2016

Interesting side note that I didn’t want to type on my phone last night: in refactoring the tests, I’ve found a lot of inconsistencies with the prepareWrite module and would like to have it fully unit tested apart from gulp.dest. So this issue comes at an opportune time. We also want to reach parity with the gulp.src method (ref #191) so a module could expose a src/dest prepare stream. As soon as I finish this test refactor, I’ll look into splitting it apart.

1reaction
phatedcommented, Jul 26, 2016

Due to this always being a Transform stream, the tests will have to always use from and to or concat. The reason vinyl-fs sinks is due to a bad pattern we support (sometimes a Transform stream/sometimes a writeable)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Techniques for Reading and Writing Files Without File ...
Explains how to create and manage files and directories.
Read more >
How to Fix the "Upload: Failed to Write File to Disk" Error in ...
In this article, we'll explain why you may be seeing the “Upload: Failed to Write File to Disk” error on your WordPress site....
Read more >
The File System Access API: simplifying access to local files
After a user grants a web app access, this API allows them to read or save changes directly to files and folders on...
Read more >
Best Practices for Data Destruction - Protecting Student Privacy
✓ Avoid using file deletion, disk formatting, and “one way” encryption to dispose of sensitive data—these methods are not effective because ...
Read more >
10 Secure File Sharing Options, Tips and Solutions - Varonis
Let's walk through some of the key positives and negatives about the process. Pros. Allows you to transfer large files over a network...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found