Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

updated modules

  • Loading branch information...
commit c1db2eca70ce41d9e114d69616b159b1fbb935dc 1 parent d9d20c8
@gagle authored
View
2  test/tests/node_modules/buffered-writer/README.md
@@ -7,7 +7,7 @@ Node BufferedWriter
[Show me!](#showme) | [Availability](#availability) | [Compatibility](#compatibility) | [Documentation](#documentation)
-Version: 0.1.11
+Version: 0.1.12
When you need to write a file you typically write the content in little chunks at a time. To avoid multiple calls to the underlying I/O layer you need to use a piece of memory called "buffer", so instead of writting directly to the disk, you write to the buffer and when it is filled the content is written to disk. Doing this you win performance.
View
2  test/tests/node_modules/buffered-writer/buffered-writer.js
@@ -1 +1 @@
-"use strict";var EVENTS=require("events"),FS=require("fs"),Error=require("errno-codes");Error.create(Error.getNextAvailableErrno(),"INVALID_BUFFER_SIZE","The buffer size must be greater than 0.");var BUFFER_SIZE=16384,EOL=process.platform.indexOf("win")!==-1?new Buffer([13,10]):new Buffer([10]),toHexArray=function(e){var t=[];do t.unshift(e&255),e>>>=8;while(e);return t},BufferedWriter=function(e,t){EVENTS.EventEmitter.call(this),t=t||{},t.bufferSize===0&&(t.bufferSize=-1),this._settings={bufferSize:t.bufferSize||BUFFER_SIZE,encoding:t.encoding||null,append:t.append?"a":"w"};if(this._settings.bufferSize<1)throw Error.get(Error.INVALID_BUFFER_SIZE);this._fileName=e,this._stream=null,this._buffer=null,this._bufferOffset=0};BufferedWriter.prototype=Object.create(EVENTS.EventEmitter.prototype),BufferedWriter.prototype.constructor=BufferedWriter,BufferedWriter.prototype._canWrite=function(e){return e+this._bufferOffset>this._settings.bufferSize&&(e=this._settings.bufferSize-this._bufferOffset),e},BufferedWriter.prototype._flush=function(){this._stream.write(new Buffer(this._bufferOffset!==this._settings.bufferSize?this._buffer.slice(0,this._bufferOffset):this._buffer)),this._bufferOffset=0},BufferedWriter.prototype._write=function(e,t,n){var r=this;this._buffer||(this._buffer=new Buffer(this._settings.bufferSize)),this.touch(r._settings.append);if(n===0)return;var i=this._canWrite(n);e.copy(this._buffer,this._bufferOffset,t,t+i),this._bufferOffset+=i,t+=i,n-=i,this._bufferOffset===this._settings.bufferSize&&(this._flush(),n!==0&&this._write(e,t,n))},BufferedWriter.prototype.close=function(e){if(!this._stream)return;this._bufferOffset!==0&&this._flush();var t=this;this._stream.on("close",function(){e&&e.call(this)}),this._stream.destroySoon(),this._stream=null,this._fd=null,this._buffer=null},BufferedWriter.prototype.newLine=function(){return this._write(EOL,0,EOL.length),this},BufferedWriter.prototype.touch=function(e){if(this._stream)return this;e=e||"w";var t=this;return this._stream=FS.createWriteStream(this._fileName,{flags:e,encoding:t._settings.encoding}).on("error",function(e){t.emit("error",e)}),this},BufferedWriter.prototype.write=function(e,t,n){var r=typeof e;if(r==="number")t=0,e=toHexArray(e),n=e.length,e=new Buffer(e);else if(r==="string")t=0,n=Buffer.byteLength(e,this._settings.encoding),e=new Buffer(e,this._settings.encoding);else{Array.isArray(e)&&(e=new Buffer(e));var i=arguments.length;i===1&&(t=0,n=e.length==0?0:1)}return this._write(e,t,n),this},module.exports=BufferedWriter;
+"use strict";var EVENTS=require("events"),FS=require("fs"),Error=require("errno-codes");Error.create(Error.getNextAvailableErrno(),"INVALID_BUFFER_SIZE","The buffer size must be greater than 0.");var BUFFER_SIZE=16384,EOL=process.platform==="win32"?new Buffer([13,10]):new Buffer([10]),toHexArray=function(a){var b=[];do b.unshift(a&255),a>>>=8;while(a);return b},BufferedWriter=function(a,b){EVENTS.EventEmitter.call(this),b=b||{},b.bufferSize===0&&(b.bufferSize=-1),this._settings={bufferSize:b.bufferSize||BUFFER_SIZE,encoding:b.encoding||null,append:b.append?"a":"w"};if(this._settings.bufferSize<1)throw Error.get(Error.INVALID_BUFFER_SIZE);this._fileName=a,this._stream=null,this._buffer=null,this._offset=0,this._closing=!1};BufferedWriter.prototype=Object.create(EVENTS.EventEmitter.prototype),BufferedWriter.prototype.constructor=BufferedWriter,BufferedWriter.prototype._flush=function(){this._stream.write(new Buffer(this._offset!==this._settings.bufferSize?this._buffer.slice(0,this._offset):this._buffer)),this._offset=0},BufferedWriter.prototype._write=function(a,b,c){var d=this;this._buffer||(this._buffer=new Buffer(this._settings.bufferSize)),this.touch(d._settings.append);if(c===0)return;var e=c+this._offset>this._settings.bufferSize?this._settings.bufferSize-this._offset:c;a.copy(this._buffer,this._offset,b,b+e),this._offset+=e,b+=e,c-=e,this._offset===this._settings.bufferSize&&(this._flush(),c!==0&&this._write(a,b,c))},BufferedWriter.prototype.close=function(a){if(this._closing||!this._stream)return;a&&(a=a.bind(this)),this._offset!==0&&this._flush();var b=this;this._stream.on("close",function(){b._stream=null,b._buffer=null,b._closing=!1,a&&a()}),this._stream.destroySoon(),this._closing=!0},BufferedWriter.prototype.newLine=function(){return this._write(EOL,0,EOL.length),this},BufferedWriter.prototype.touch=function(a){if(this._closing)return this;a=a||"w";var b=this;return this._stream=FS.createWriteStream(this._fileName,{flags:a,encoding:b._settings.encoding}).on("error",function(a){b.emit("error",a)}),this},BufferedWriter.prototype.write=function(a,b,c){if(this._closing)return this;var d=typeof a;if(d==="number")b=0,a=toHexArray(a),c=a.length,a=new Buffer(a);else if(d==="string")b=0,c=Buffer.byteLength(a,this._settings.encoding),a=new Buffer(a,this._settings.encoding);else{Array.isArray(a)&&(a=new Buffer(a));var e=arguments.length;e===1&&(b=0,c=a.length===0?0:1)}return this._write(a,b,c),this},module.exports=BufferedWriter;
View
3  test/tests/node_modules/buffered-writer/node_modules/errno-codes/package.json
@@ -25,8 +25,5 @@
"main": "error",
"readme": "<a name=\"start\"></a>\r\n\r\nNode Error\r\n==========\r\n\r\n#### Exposes the errno codes for node.js. ####\r\n\r\n[Show me!](#showme) | [Availability](#availability) | [Compatibility](#compatibility) | [Documentation](#documentation)\r\n\r\nVersion: 1.0.1\r\n\r\nWhen you are writing a node.js module you'll probably deal with errors. If you get a predefined error you can just resend it but if you want to instantiate a predefined one you need an errno code. Node.js does not expose these errors. Furthermore, they're not the standard errno codes. They are defined at [`deps/uv/include/uv.h`](https://github.com/joyent/node/blob/master/deps/uv/include/uv.h).\r\n\r\nThis module eases the error management providing predefined `Error` instances for every errno code and the ability to create customized errors.\r\n\r\n<a name=\"showme\"></a>\r\n#### Show me! [↑](#start) ####\r\n\r\n```javascript\r\nvar Error = require (\"error\");\r\n\r\nconsole.log (Error.get (Error.ENOENT));\r\n\r\n/*\r\nPrints:\r\n\r\n{\r\n\t[Error: ENOENT]\r\n\terrno: 34,\r\n\tcode: \"ENOENT\",\r\n\tdescription: \"no such file or directory\"\r\n}\r\n*/\r\n```\r\n\r\n***\r\n\r\n<a name=\"availability\"></a>\r\n#### Availability [↑](#start) ####\r\n\r\nVia npm:\r\n\r\n```\r\nnpm install errno-codes\r\n```\r\n\r\nOr simply copying `build/error.js` into your project's directory and `require()` accordingly.\r\n\r\n***\r\n\r\n<a name=\"compatibility\"></a>\r\n#### Compatibility [↑](#start) ####\r\n\r\n✔ Node *\r\n\r\n***\r\n\r\n<a name=\"documentation\"></a>\r\n#### Documentation [↑](#start) ####\r\n \r\n[Reference](https://github.com/Gagle/Node-Error/wiki/Reference) \r\n[Examples](https://github.com/Gagle/Node-Error/tree/master/examples) \r\n[Change Log](https://github.com/Gagle/Node-Error/wiki/Change-Log) \r\n[MIT License](https://github.com/Gagle/Node-Error/blob/master/LICENSE)",
"_id": "errno-codes@1.0.1",
- "dist": {
- "shasum": "a9a3264d67600c0058f76edb19fbf4128ffb66ec"
- },
"_from": "errno-codes@*"
}
View
10 test/tests/node_modules/buffered-writer/package.json
@@ -1,6 +1,6 @@
{
"name": "buffered-writer",
- "version": "0.1.11",
+ "version": "0.1.12",
"description": "Fully configurable buffered writer.",
"keywords": [
"buffer",
@@ -33,10 +33,10 @@
}
],
"main": "buffered-writer",
- "readme": "<a name=\"start\"></a>\r\n\r\nNode BufferedWriter\r\n===================\r\n\r\n#### Fully configurable buffered writer for node.js ####\r\n\r\n[Show me!](#showme) | [Availability](#availability) | [Compatibility](#compatibility) | [Documentation](#documentation)\r\n\r\nVersion: 0.1.11\r\n\r\nWhen you need to write a file you typically write the content in little chunks at a time. To avoid multiple calls to the underlying I/O layer you need to use a piece of memory called \"buffer\", so instead of writting directly to the disk, you write to the buffer and when it is filled the content is written to disk. Doing this you win performance.\r\n\r\nThis library allows you to write files using internal buffers, so you don't have to worry about them.\r\n\r\n<a name=\"showme\"></a>\r\n#### Show me! [↑](#start) ####\r\n\r\n```javascript\r\nvar BufferedWriter = require (\"buffered-writer\");\r\n\r\nnew BufferedWriter (\"file\")\r\n\t.on (\"error\", function (error){\r\n\t\tconsole.log (error);\r\n\t})\r\n\t\r\n\t.write ([0x00, 0x01, 0x02], 0, 3) //Writes 0x00, 0x01, 0x02\r\n\t.write (new Buffer ([0x03, 0x04]), 1, 1) //Writes 0x04\r\n\t.write (0x0506) //Writes 0x05, 0x06\r\n\t.close ();\r\n```\r\n\r\n***\r\n\r\n<a name=\"availability\"></a>\r\n#### Availability [↑](#start) ####\r\n\r\nVia npm:\r\n\r\n```\r\nnpm install buffered-writer\r\n```\r\n\r\n***\r\n\r\n<a name=\"compatibility\"></a>\r\n#### Compatibility [↑](#start) ####\r\n\r\n✔ Node 0.4.10+\r\n\r\n***\r\n\r\n<a name=\"documentation\"></a>\r\n#### Documentation [↑](#start) ####\r\n \r\n[Reference](https://github.com/Gagle/Node-BufferedWriter/wiki/Reference) \r\n[Examples](https://github.com/Gagle/Node-BufferedWriter/tree/master/examples) \r\n[Change Log](https://github.com/Gagle/Node-BufferedWriter/wiki/Change-Log) \r\n[MIT License](https://github.com/Gagle/Node-BufferedWriter/blob/master/LICENSE)",
- "_id": "buffered-writer@0.1.11",
+ "readme": "<a name=\"start\"></a>\r\n\r\nNode BufferedWriter\r\n===================\r\n\r\n#### Fully configurable buffered writer for node.js ####\r\n\r\n[Show me!](#showme) | [Availability](#availability) | [Compatibility](#compatibility) | [Documentation](#documentation)\r\n\r\nVersion: 0.1.12\r\n\r\nWhen you need to write a file you typically write the content in little chunks at a time. To avoid multiple calls to the underlying I/O layer you need to use a piece of memory called \"buffer\", so instead of writting directly to the disk, you write to the buffer and when it is filled the content is written to disk. Doing this you win performance.\r\n\r\nThis library allows you to write files using internal buffers, so you don't have to worry about them.\r\n\r\n<a name=\"showme\"></a>\r\n#### Show me! [↑](#start) ####\r\n\r\n```javascript\r\nvar BufferedWriter = require (\"buffered-writer\");\r\n\r\nnew BufferedWriter (\"file\")\r\n\t.on (\"error\", function (error){\r\n\t\tconsole.log (error);\r\n\t})\r\n\t\r\n\t.write ([0x00, 0x01, 0x02], 0, 3) //Writes 0x00, 0x01, 0x02\r\n\t.write (new Buffer ([0x03, 0x04]), 1, 1) //Writes 0x04\r\n\t.write (0x0506) //Writes 0x05, 0x06\r\n\t.close ();\r\n```\r\n\r\n***\r\n\r\n<a name=\"availability\"></a>\r\n#### Availability [↑](#start) ####\r\n\r\nVia npm:\r\n\r\n```\r\nnpm install buffered-writer\r\n```\r\n\r\n***\r\n\r\n<a name=\"compatibility\"></a>\r\n#### Compatibility [↑](#start) ####\r\n\r\n✔ Node 0.4.10+\r\n\r\n***\r\n\r\n<a name=\"documentation\"></a>\r\n#### Documentation [↑](#start) ####\r\n \r\n[Reference](https://github.com/Gagle/Node-BufferedWriter/wiki/Reference) \r\n[Examples](https://github.com/Gagle/Node-BufferedWriter/tree/master/examples) \r\n[Change Log](https://github.com/Gagle/Node-BufferedWriter/wiki/Change-Log) \r\n[MIT License](https://github.com/Gagle/Node-BufferedWriter/blob/master/LICENSE)",
+ "_id": "buffered-writer@0.1.12",
"dist": {
- "shasum": "8ce270c1483872b4404e4e240aeeacfcb23eaeef"
+ "shasum": "ed7422fc67e255d91eac999795411cbdd4c66762"
},
- "_from": "buffered-writer@0.1.11"
+ "_from": "buffered-writer@0.1.12"
}
Please sign in to comment.
Something went wrong with that request. Please try again.