Skip to content
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

fixes #50 #51

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,15 @@ Returns the stream.

Returns a pretty String interpretation of the File. Useful for console.log.

### contents

The [stream](https://nodejs.org/api/stream.html#stream_stream) or [buffer](https://nodejs.org/api/buffer.html#buffer_class_buffer) of the file. For example:
```js
if (file.isBuffer()) {
var contents = file.contents.toString('utf8')
Copy link
Member

Choose a reason for hiding this comment

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

var inside an if is bad JS

Copy link
Member

Choose a reason for hiding this comment

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

@contra no it isn't and it's actually correct as per node styleguide

Copy link
Member

Choose a reason for hiding this comment

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

@phated guess i got brainwashed by crockford

Copy link
Author

Choose a reason for hiding this comment

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

lol i was actually thinking about this while writing the example but then i was like mehhhh adding a var declaration above seemed like too much...

Choose a reason for hiding this comment

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

The .toString argument is also moot as it's the default.

}
```

### path

Absolute pathname string or `undefined`. Setting to a different value pushes the old value to `history`.
Expand Down