Skip to content

gulpのexample #78

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Oct 6, 2015
Merged

gulpのexample #78

merged 14 commits into from
Oct 6, 2015

Conversation

azu
Copy link
Owner

@azu azu commented Sep 29, 2015

#16 のExampleコード

他の章にならってとりあえず直接Streamを書いてるんだけど、gulpはgulp向けstreamとstreamライブラリを組み合わせて使うもんなんだなという理解をした。

gulpのExampleとしてはかなり良くないけどどうするべきか。(動きを理解するものとしては何も抽象化されてないので分かる感じ

@azu
Copy link
Owner Author

azu commented Oct 2, 2015

どういう仕組みが長すぎるので、StreamとVinlyで分けるべき

@azu
Copy link
Owner Author

azu commented Oct 5, 2015

今回は素のStreamでやってるけど、普通はライブラリ使うらしいと言う話が必要そう

この[Buffer](https://nodejs.org/api/buffer.html "Buffer")は文字列オブジェクトと相互変換が可能ですが、複数の値を持ったオブジェクトを扱うのは少し大変です。

そのため、Node.js Streamには[Object Mode](https://nodejs.org/api/stream.html#stream_object_mode "Object Mode")があり、
JavaScriptのオブジェクトそのものをStreamで流せるようになっています。
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

この"JavaScriptのオブジェクト"という表現良くない気がする。

generic JavaScript values other than Buffers and Strings.

// Outputs vinyl File objects
readableObjectMode: true,
transform: function (file, encoding, next) {
if (file.isBuffer()) {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

一応Null対応も欲しい?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

公式も省いてるからいいや

azu added a commit that referenced this pull request Oct 6, 2015
@azu azu merged commit 20f05bd into master Oct 6, 2015
@azu azu deleted the gulp-example branch October 6, 2015 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant