Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add File#toJSON()

void of ._writeStream
  • Loading branch information...
commit 1dd3767e5b578100d8bb5e679705382a9137446f 1 parent 1173718
TJ Holowaychuk authored
Showing with 14 additions and 0 deletions.
  1. +14 −0 lib/file.js
14 lib/file.js
View
@@ -32,6 +32,20 @@ File.prototype.open = function() {
this._writeStream = new WriteStream(this.path);
};
+File.prototype.toJSON = function() {
+ return {
+ size: this.size,
+ path: this.path,
+ name: this.name,
+ type: this.type,
+ hash: this.hash,
+ mtime: this.lastModifiedDate,
+ length: this.length,
+ filename: this.filename,
+ mime: this.mime
+ }
+}
+
File.prototype.write = function(buffer, cb) {
var self = this;
this._writeStream.write(buffer, function() {
Please sign in to comment.
Something went wrong with that request. Please try again.