{"_id":"fs-js","_rev":"2-355d4a5cc229232467649bf2f3775900","name":"fs-js","description":"A native module for effectively working with files built on top of Node's famous fs module.","dist-tags":{"latest":"1.0.6"},"versions":{"1.0.6":{"name":"fs-js","version":"1.0.6","description":"A native module for effectively working with files built on top of Node's famous fs module.","main":"index.js","repository":{"type":"git","url":"git+https://github.com/zlatinejc/fs.git"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"zlatinejc"},"license":"MIT","keywords":["fs-js","fs","filesystem","file","files","rw","dir","link","unlink","sync","async","read","write","directory","directories","append","reading","writing","appending"],"gitHead":"18ccf2cca13c0b1ef6218aa05952e56f9706e9bb","bugs":{"url":"https://github.com/zlatinejc/fs/issues"},"homepage":"https://github.com/zlatinejc/fs#readme","_id":"fs-js@1.0.6","_shasum":"ff71521028781393c67dea891a883abe04a100ac","_from":".","_npmVersion":"2.14.2","_nodeVersion":"4.0.0","_npmUser":{"name":"zlatinejc","email":"zlatinejc@gmail.com"},"dist":{"shasum":"ff71521028781393c67dea891a883abe04a100ac","tarball":"https://registry.npmjs.org/fs-js/-/fs-js-1.0.6.tgz","integrity":"sha512-Y4MPgFBY/6QIFvGzWD/TGbcgFEOfyRfWFRHpGERjmlqe5aHP2inb1M2BiEzITu6rxjDeEkV5bbwkHTjH6BadEA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCUc2UnWs6FAVLtqfKsADeUsvtJva8M3I6hfa7yNs4HqwIhAPEt03FFOC1LHjKxz45EvnlET96EAHtSgVFNAnEaWqTQ"}]},"maintainers":[{"name":"zlatinejc","email":"zlatinejc@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fs-js-1.0.6.tgz_1497338719678_0.7502624276094139"}}},"readme":"# fs\r\nA native module for effectively working with files built on top of Node's famous fs module.\r\n\r\n## Installation\r\n\r\nWith [npm](https://npmjs.org) do\r\n\r\n```bash\r\n$ npm install fs-js\r\n```\r\n\r\n## Usage\r\n\r\n```js\r\nvar fs = require('fs-js');\r\n```\r\n\r\n## Open file\r\n\r\n```js\r\nfs.open('myfile', 'wx', (err, fd) => {\r\n  if (err) {\r\n    if (err.code === 'EEXIST') {\r\n      console.error('myfile already exists');\r\n      return;\r\n    }\r\n\r\n    throw err;\r\n  }\r\n\r\n  writeMyData(fd);\r\n});\r\n\r\n```\r\n\r\n## Read file\r\n\r\n```js\r\nfs.open('myfile', 'r', (err, fd) => {\r\n  if (err) {\r\n    if (err.code === 'ENOENT') {\r\n      console.error('myfile does not exist');\r\n      return;\r\n    }\r\n\r\n    throw err;\r\n  }\r\n\r\n  readMyData(fd);\r\n});\r\n```\r\n\r\n## Write file\r\n\r\n```js\r\nfs.open('myfile', 'wx', (err, fd) => {\r\n  if (err) {\r\n    if (err.code === 'EEXIST') {\r\n      console.error('myfile already exists');\r\n      return;\r\n    }\r\n\r\n    throw err;\r\n  }\r\n\r\n  writeMyData(fd);\r\n});\r\n```\r\n\r\n## Delete file\r\n```js\r\nfs.unlink('/tmp/hello', (err) => {\r\n  if (err) throw err;\r\n  console.log('successfully deleted /tmp/hello');\r\n});\r\n```\r\n## Append file\r\n```js\r\nfs.appendFile('message.txt', 'data to append', (err) => {\r\n  if (err) throw err;\r\n  console.log('The \"data to append\" was appended to file!');\r\n});\r\n```\r\n## Rename file\r\n```js\r\nfs.rename('/tmp/hello', '/tmp/world', (err) => {\r\n  if (err) throw err;\r\n  console.log('renamed complete');\r\n});\r\n```\r\n\r\n## Documentation\r\n\r\nPublicly accessible documentation is located [here](https://nodejs.org/api/fs.html).\r\n\r\n## License\r\n\r\n(MIT)\r\n\r\nCopyright (c) 2017 Nejc Trnjanin &lt;zlatinejc@gmail.com&gt;\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy of\r\nthis software and associated documentation files (the \"Software\"), to deal in\r\nthe Software without restriction, including without limitation the rights to\r\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\r\nof the Software, and to permit persons to whom the Software is furnished to do\r\nso, subject to the following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be included in all\r\ncopies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\nSOFTWARE.","maintainers":[{"name":"zlatinejc","email":"zlatinejc@gmail.com"}],"time":{"modified":"2022-06-18T03:53:36.836Z","created":"2017-06-13T07:25:20.632Z","1.0.6":"2017-06-13T07:25:20.632Z"},"homepage":"https://github.com/zlatinejc/fs#readme","keywords":["fs-js","fs","filesystem","file","files","rw","dir","link","unlink","sync","async","read","write","directory","directories","append","reading","writing","appending"],"repository":{"type":"git","url":"git+https://github.com/zlatinejc/fs.git"},"author":{"name":"zlatinejc"},"bugs":{"url":"https://github.com/zlatinejc/fs/issues"},"license":"MIT","readmeFilename":"README.md"}