{"author":{"name":"Matt Sergeant","email":"helpme@gmail.com","url":"http://baudehlo.wordpress.com/"},"name":"fs-ext","description":"Extensions to core 'fs' module.","keywords":["fs","filesystem","flock","seek"],"version":"2.0.0","homepage":"https://github.com/baudehlo/node-fs-ext/","repository":{"type":"git","url":"git://github.com/baudehlo/node-fs-ext.git"},"main":"fs-ext.js","engines":{"node":">= 8.0.0"},"dependencies":{"nan":"^2.14.0"},"licenses":[{"type":"MIT"}],"bugs":{"url":"https://github.com/baudehlo/node-fs-ext/issues"},"scripts":{"install":"node-gyp configure build","test":"node ./run_tests","lint":"node ./node_modules/eslint/bin/eslint \"*.js\" \"tests/**/*.js\"","cover":"NODE_ENV=cov ./node_modules/.bin/istanbul cover node ./run_tests"},"devDependencies":{"eslint":"^5.9.0"},"gitHead":"3125353321c30bd35fc38e40ce76ffe3872e215b","_id":"fs-ext@2.0.0","_npmVersion":"6.2.0","_nodeVersion":"10.9.0","_npmUser":{"name":"msergeant","email":"helpme@gmail.com"},"dist":{"integrity":"sha512-aK8NlpSO5LUdSoWeshpnkgtptbua1rGo58Wc+mHQ2+JnoBlubMTsnV56Swl4bA0msrgAhG8TDu1aGS8deJwzBQ==","shasum":"e58168fcc37506a9358e0928f4aae60912af7caa","tarball":"http://registry-npm.ywwl.com/fs-ext/download/fs-ext-2.0.0.tgz","fileCount":18,"unpackedSize":78366,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdxIsVCRA9TVsSAnZWagAAwj8QAJqbIf/BI9RnPIS8fy3T\nApMcF+ygoGrOyJRAndtciUpe8aPEVBw/8fWYFGlKsRXjcx10PZTiaDVKBlI5\nk2MOAKCT8CNAXjMQS2k/vPQOi1YPpcDe3HnQqPOFmEwCOIVW3WVxODnOdb9L\nowZPzrAHU/0hAzpImzjHuUi4+vTUKC0ntYAHdm4apwVQqPD7RXgtZv3NZGu0\nSnptMPZzJfopEw9uXMPeuRQvCGqrfoaG7kdJPle06IV0aSXSctu7krJ/T+2+\nTI7n60Q2xCSEC+pLffR2m+SuY9R/g/8L3c6Lh6vDz76PKe5VTHEIe+3V1iFk\nM/iqCuIHhVKUXVVBD3IPoiH0QFYSJydcRIy8ez/4gtQ6/BNgha02l4gWVbQJ\nuFJhXL6GTePrD7QylT376yX0z9C7YteYjAF3IwAfY9/pHrYPf15KR8m4qmVf\nyFRBQK03kqVQfUww01Os4y7r1esBLabqj/GR9m0O2GpfhyhM8WYD8kO2zW6E\nzsU+/eDFB0W3R5jyNyUkU63Zm0HGtIDfCpr/ihbCTaFNgNVzZ3T5DuHGnY3U\nMvI7b39G8YQ0LuUFX5Bjn7m6E8NRWmXCDp0ZZ36HmQQnwqp/xY2XEEOIuo8T\nq0cfKTjVS+61vBTi5EpwgfeOjuSLThdlLo4YNR6K6OQf0q44S1e55MQP/r4Z\nky/p\r\n=MWic\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA3KO1bKHFMVN0WUMjoBvP5dOwN6dPpyJIu+tp3erPnTAiBxv7RDDIzuPKUB7U4wyYDWj5DohiVJNIcxp4PUxHCGsA=="}],"size":14640,"noattachment":false,"key":"/fs-ext/-/fs-ext-2.0.0.tgz"},"maintainers":[{"name":"msergeant","email":"helpme@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fs-ext_2.0.0_1573161748570_0.43034475356818414"},"_hasShrinkwrap":false,"readme":"fs-ext\n======\n\n[![Build Status][ci-img]][ci-url]\n[![Coverage Status][cov-img]][cov-url]\n[![Windows Status][ci-win-img]][ci-win-url]\n\nExtras not included in Node's fs module.\n\n**Note**:\n\n* From `v2.0.0` onwards, module doesn't override `fs` and `constants` Node.js core modules. Instead\n  import functions and constants directly:\n\n  ```js\n  const {flock, constants} = require('fs-ext');\n  // or\n  const fsExt = require('fs-ext');\n  // fsExt.flock\n  // fsExt.constants\n  ```\n\n* From `v1.0.0` onwards, fs.utime and fs.utimeSync have been removed.\n  Use fs.utimes and fs.utimesSync instead.\n\nInstallation\n------------\n\nInstall via npm:\n\n```sh\nnpm install fs-ext\n```\n\nUsage\n-----\n\nfs-ext imports all of the methods from the core 'fs' module, so you don't\nneed two objects.\n\n```js\nconst fs = require('fs');\nconst {flock} = require('fs-ext');\n\nconst fd = fs.openSync('foo.txt', 'r');\nflock(fd, 'ex', (err) => {\n    if (err) {\n        return console.error(\"Couldn't lock file\");\n    }\n    // file is locked\n});\n```\n\nFor an advanced example checkout `example.js`.\n\nAPI\n---\n\n### flock(fd, flags, [callback])\n\nAsynchronous flock(2). No arguments other than a possible error are passed to\nthe callback. Flags can be 'sh', 'ex', 'shnb', 'exnb', 'un' and correspond\nto the various LOCK_SH, LOCK_EX, LOCK_SH|LOCK_NB, etc.\n\nNOTE (from flock() man page): flock() does not lock files over NFS. Use fcntl(2)\ninstead: that does work over NFS, given a sufficiently recent version of Linux\nand a server which supports locking.\n\n\n### flockSync(fd, flags)\n\nSynchronous flock(2). Throws an exception on error.\n\n### fcntl(fd, cmd, [arg], [callback])\n\nAsynchronous fcntl(2).\n\ncallback will be given two arguments (err, result).\n\nThe supported commands are:\n\n- 'getfd' ( F_GETFD )\n- 'setfd' ( F_SETFD )\n- 'setlk' ( F_SETLK )\n- 'getlk' ( F_GETLK )\n- 'setlkw' ( F_SETLKW )\n\nRequiring this module adds `FD_CLOEXEC` to the constants module, for use with F_SETFD,\nand also F_RDLCK, F_WRLCK and F_UNLCK for use with F_SETLK (etc).\n\nFile locking can be used like so:\n\n```js\nconst {fnctl, constants} = require('fs-ext');\n\nfcntl(fd, 'setlkw', constants.F_WRLCK, (err) => {\n    if (!err) {\n        // Lock succeeded\n    }\n});\n```\n\n### fcntlSync(fd, flags)\n\nSynchronous fcntl(2). Throws an exception on error.\n\n### seek(fd, offset, whence, [callback])\n\nAsynchronous lseek(2).\n\ncallback will be given two arguments (err, currFilePos).\n\nwhence can be 0 (SEEK_SET) to set the new position in bytes to offset,\n1 (SEEK_CUR) to set the new position to the current position plus offset\nbytes (can be negative), or 2 (SEEK_END) to set to the end of the file\nplus offset bytes (usually negative or zero to seek to the end of the file).\n\n### seekSync(fd, offset, whence)\n\nSynchronous lseek(2). Throws an exception on error.  Returns current\nfile position.\n\n\n\n[ci-img]: https://travis-ci.org/baudehlo/node-fs-ext.svg?branch=master\n[ci-url]: https://travis-ci.org/baudehlo/node-fs-ext\n[cov-img]: https://codecov.io/github/baudehlo/node-fs-ext/coverage.svg\n[cov-url]: https://codecov.io/github/baudehlo/node-fs-ext?branch=master\n[ci-win-img]: https://ci.appveyor.com/api/projects/status/pqbnutckk0n46uc8?svg=true\n[ci-win-url]: https://ci.appveyor.com/project/baudehlo/node-fs-ext/branch/master\n","publish_time":1573161748717,"_cnpm_publish_time":1573161748717,"dist-tags":{"latest":"2.1.1"}}