{"_id":"file-save","_rev":"12-d63e00e8bb78ecb4e13213517f677dee","name":"file-save","description":"auto create path and just save the file!","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"file-save","version":"0.1.0","description":"auto create path and just save the file!","main":"index.js","scripts":{"test":"./node_modules/.bin/mocha"},"repository":{"type":"git","url":"git@github.com:chilijung/file-save.git"},"keywords":["file","save"],"author":{"name":"chilijung","email":"chilijung@gmail.com","url":"http://lijung.com/"},"license":"MIT","bugs":{"url":"https://github.com/chilijung/file-save/issues"},"homepage":"https://github.com/chilijung/file-save","dependencies":{"mkdirp":"~0.3.5"},"devDependencies":{"mocha":"~1.17.1","should":"~3.1.2"},"_id":"file-save@0.1.0","dist":{"shasum":"ecd9b96000f8907ecfe838fc72fafe459f072bda","tarball":"https://registry.npmjs.org/file-save/-/file-save-0.1.0.tgz","integrity":"sha512-DzEYVffRW7ycqw4cQcMUC0vRgtV3ONF+69jd3wPQ4iF+b5BlnI8kiW6INNOiGqjjUCtuUYmcoBIv0b0Z9RsaOA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHTVw++KFcBPVHOU0FfAMdFjsWUuplhKTOnLLKb8TB8iAiEA8ziW51NWQec9O0D8LD14zDiaGsLg0hEC9Zn1UJBgTC8="}]},"_from":"./","_npmVersion":"1.3.17","_npmUser":{"name":"chilijung","email":"chilijung@gmail.com"},"maintainers":[{"name":"chilijung","email":"chilijung@gmail.com"}],"directories":{}},"0.1.1":{"name":"file-save","version":"0.1.1","description":"auto create path and just save the file!","main":"index.js","scripts":{"test":"./node_modules/.bin/mocha"},"repository":{"type":"git","url":"git@github.com:chilijung/file-save.git"},"keywords":["file","save"],"author":{"name":"chilijung","email":"chilijung@gmail.com","url":"http://lijung.com/"},"license":"MIT","bugs":{"url":"https://github.com/chilijung/file-save/issues"},"homepage":"https://github.com/chilijung/file-save","dependencies":{"mkdirp":"~0.3.5"},"devDependencies":{"mocha":"~1.17.1","should":"~3.1.2"},"_id":"file-save@0.1.1","dist":{"shasum":"a0fc9bbc95cf94996353b2c2363273b87d693903","tarball":"https://registry.npmjs.org/file-save/-/file-save-0.1.1.tgz","integrity":"sha512-1FCMc+St3vcCBV/Fz4Y9MXHsn0VGIweRu1fy4wPWqAaBBmLXYWzwDXWze4I1EaQVi8S2nbPhQzOPySgfufdQZQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC7G481gOeAbjA7b0le7n5iQDlp578VTevOyWrN+BgRpwIhANDAv7uKAdxCn/xxJPjAT/SbJtAvx0EJSaGgwcKgVNV/"}]},"_from":"./","_npmVersion":"1.3.17","_npmUser":{"name":"chilijung","email":"chilijung@gmail.com"},"maintainers":[{"name":"chilijung","email":"chilijung@gmail.com"}],"directories":{}},"0.2.0":{"name":"file-save","version":"0.2.0","description":"auto create path and just save the file!","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git@github.com:chilijung/file-save.git"},"keywords":["file","save"],"author":{"name":"chilijung","email":"chilijung@gmail.com","url":"http://lijung.com/"},"license":"MIT","bugs":{"url":"https://github.com/chilijung/file-save/issues"},"homepage":"https://github.com/chilijung/file-save","dependencies":{"mkdirp":"~0.5.0"},"devDependencies":{"mocha":"~1.17.1","should":"~3.1.2"},"_id":"file-save@0.2.0","dist":{"shasum":"39b20d0214e656b1417faa3c32d317b678545db7","tarball":"https://registry.npmjs.org/file-save/-/file-save-0.2.0.tgz","integrity":"sha512-teMqpbPLBDAHEDAPYEb8fGfng4S6eGZcsN0CLM1ow0w1vtqTMBwNmd82dEc81O3C1BEs1EY8L18Ma6Q6O++v1A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDhayn6yDMOXE7EZoEFvFcBu4SW3k6Hzi5Xm3+Po1alwQIgfYzs2ReGQdSMipVvniVupmlekN/xlOBIeVGjH5pPSBw="}]},"_from":".","_npmVersion":"1.4.4","_npmUser":{"name":"chilijung","email":"chilijung@gmail.com"},"maintainers":[{"name":"chilijung","email":"chilijung@gmail.com"}],"directories":{}}},"readme":"# Streaming saving file\n\n[![Build Status](https://travis-ci.org/chilijung/file-save.png)](https://travis-ci.org/chilijung/file-save)\n\nStreaming data to file and save it using Stream.(the module will make directory itself if the directory is not exist).\n\n## Install\n\n```\nnpm install file-save\n```\n\n## Example\n\n```javascript\nvar fileSave = require('file-save');\n\n// the first line will create a writeStream to the file path\nfileSave('sample/test')\n    .write('this is the first line', 'utf8')\n    .write('this is the second line', 'utf8', function() {\n        console.log('writer callback')\n    })\n    .end('this is the end')\n    .error(function() {\n        console.log('error goes here')\n    })\n    .finish(function() {\n        console.log('write finished.')\n    })\n```\n\n## Usage\n\n```\nfileSave(<filename>)\n```\n\n`file-save` module will build a write stream to the file, and automatically make directory if the directory is not exist and need to create.\n\n## Chaining methods\n\n#### .write(chunk, [encoding], [callbak])\n\n- chunk (string)\n- encoding (string): like the encoding settings in writeable stream. http://nodejs.org/api/stream.html#stream_writable_write_chunk_encoding_callback \n- callback (function): callback function settings in writeable http://nodejs.org/api/stream.html#stream_writable_write_chunk_encoding_callback\n\n#### .end([string], [encoding], [callback])\n\nSame as `.write` method, but string is also optional.\n\n#### .error(callback)\n\nYou can make a callback, while the stream prompt error\n\nsee more: http://nodejs.org/api/stream.html#stream_event_error_1\n\n#### .finish(callback)\n\nMake a callback while finished, **using this method you have to call ** `.foot` **before calling this method**\n\nsee more: http://nodejs.org/api/stream.html#stream_event_finish\n\n## License\n\nMIT [@chilijung](http://github.com/chilijung)\n","maintainers":[{"name":"chilijung","email":"chilijung@gmail.com"}],"time":{"modified":"2022-12-09T07:32:38.016Z","created":"2014-02-15T04:03:48.853Z","0.1.0":"2014-02-15T04:09:24.869Z","0.1.1":"2014-02-16T05:05:49.611Z","0.2.0":"2014-07-08T03:17:54.147Z"},"readmeFilename":"README.md","author":{"name":"chilijung","email":"chilijung@gmail.com","url":"http://lijung.com/"},"repository":{"type":"git","url":"git@github.com:chilijung/file-save.git"},"homepage":"https://github.com/chilijung/file-save","keywords":["file","save"],"bugs":{"url":"https://github.com/chilijung/file-save/issues"},"license":"MIT","users":{"tstonelee":true}}