Comments (6)
I toyed with this locally, switching from through2
was easy and all tests passed. Worth noting streamx
is documented as always running in both binary and object mode, so I think the only difference on require('fs-mkdirp-stream').obj
is that it will pass highWaterMark: 16
to the constructor.
While I was working on the code I hit three lint parser errors:
- destructuring -
const {Transform} = require('streamx')
- object method shorthand -
{ transform(chunk, cb) { /* code here */ } }
- object spread -
{...options, /* other properties */}
Would you be open to adding "env": {"es2017": true}, "parserOptions": {"ecmaVersion": 2018}
to eslint-config-gulp? Setting env.es2017
enables current globals, ecmaVersion enables current syntax. I know you just recently bumped this package to requiring node.js 10 which is why I'm suggesting ecmaVersion 2018 (2019 allows syntax that is for node.js 12+). Since ES5 is the default parser mode for eslint I'm not sure if you want to block newer syntax or if you simply haven't specified/updated it.
from fs-mkdirp-stream.
Thanks for digging into this! I need to do some more digging, but I thought it wasn't required to set highWaterMark for objects.
With the update to node 10+, I'm fine supporting whichever syntax that runtime supports. I just didn't bother changing the parser since I wasn't planning to update rewrite libraries.
from fs-mkdirp-stream.
In the current release highWaterMark is set for obj only.
from fs-mkdirp-stream.
Sorry, I meant that streamx is supposed to handle hwm according to the data flowing through the stream (according to the docs, but I haven't dug into the code). All of these changes are going to be batched into a major, so we can drop the .obj method.
An aside: I know you have a ton going on, but would you also be interested in joining the gulpjs core team? If not, I totally understand.
from fs-mkdirp-stream.
Looks like it unconditionally sets default hwm 16384.
Yes I'd be interested in joining the gulpjs core team. I can't promise consistent effort, my availability for open source tends to come in spurts.
from fs-mkdirp-stream.
Looks like it unconditionally sets default hwm 16384.
Yeah, that's the hwm, but streamx
uses the byteLength
method in conjunction with hwm to determine the amount of data/objects that can go in the stream. If we don't specify
a byteLength
method, the default
is used, which checks if the data is a buffer otherwise returns 1024
and 16384 / 1024
is the 16 objects we'd expect.
The docs also mention this as
"The default byteLength function returns the byte length of buffers and 1024 for any other object. This means the buffer will contain around 16 non buffers or buffers worth 16kb when full if the defaults are used."
Yes I'd be interested in joining the gulpjs core team. I can't promise consistent effort, my availability for open source tends to come in spurts.
Awesome! That's pretty much all of us too. I'll send the invite now and finish setting permissions, etc up this week.
from fs-mkdirp-stream.
Related Issues (8)
- node.js version support HOT 2
- Update example in readme
- Add tests for various types of streams.
- ENOTSUP error when copying files to a fs that doesn't support chmod HOT 2
- Errors with ENOENT when directory is a dangling link HOT 8
- System Errors don't seem to have a stack trace HOT 9
- Drop graceful-fs? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fs-mkdirp-stream.