{"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":"1.2.1","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.10.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":"^2.13.0"},"gitHead":"7c9824f3dc330e795aa13359d96252860bd3a684","_id":"fs-ext@1.2.1","_npmVersion":"5.4.2","_nodeVersion":"8.8.1","_npmUser":{"name":"msergeant","email":"helpme@gmail.com"},"maintainers":[{"name":"msergeant","email":"helpme@gmail.com"}],"dist":{"integrity":"sha512-+69gpKDsQERtexv9A1Fzm7i2P5aYK8sGfmV7l+JFMo4XJNAb9iPyMyr4oG3bu+qdc0hlodzRm0nDQ9R4oZR6xA==","shasum":"1c2c9c115e48a1af99374c7b9aa9d39019d5f409","tarball":"http://registry-npm.ywwl.com/fs-ext/download/fs-ext-1.2.1.tgz","fileCount":12,"unpackedSize":29904,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbJ86SCRA9TVsSAnZWagAAEc4P/3W72lWeaEZdXRDO8COa\nnAVGuQ+tZW/aDYsLFjichGV7j+qc8p5uT1DXsJJvo8Rh3q/9u2gCqq6snTfo\ntJhdlSLz8LN9/3JGLp8QYJFQRwpU3neSxD97ooFBuagtsSs9qeZEaADWKsD1\nUoe1flagPMHXQl+C0F2DCvKMwT2Ob3kMfZXYc1Fn68no1ic09Drm5BGUdo6V\n/lNDJXxOfhOl4yR4kEVpmyvwih6C/QPjV2RPHVLXbFpxe5+a2cQIwRQknj99\ngiPY/jo02fCaRmTJkiKo4T5pk2cyUi9omzXRoGE6VsU2YZeWxmii5HHqRYPn\npZqNqUb0gn/5euFuuCBlufraI7EM+g8Fw3tngNd6vAgrmcd4BYLfaYYoRUEd\nbKZ25KnXQlayrUK61aJwS+ZjtTersMOlN0+STccpiG53G+ewA6T4qFW5Zh46\nINlrp2z3B13XpOiumQSo4DfTGrf7n4meyN5qBJSlJHhgLKyWZz+ewx8UfXWZ\nFY7/AnkNGp6e7WgmmpRW1fmVU8hqYfBUfxZmlz7IbleuyCOIc51bbgRms6aD\n7+HDPwOPlxoAdlNooPGxSneWqmEM8b9tIcgv2i491x9GyhGYQvhBLDijNS86\n7EYQNxBJmGF0VbADgWXaQzmicU0/L7L+HNNLHgARY4axpCIV4T1rKoUEbi8P\nKL5R\r\n=Yekt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDFJHwexTaugTF4UZt9QBcQp1AEApVuEoKWWkMMbLkVlgIhANkjGZQBtJmmE+bYkHV+YGSQm0ck30EPp2H4/hVKPyDn"}],"size":8720,"noattachment":false,"key":"/fs-ext/-/fs-ext-1.2.1.tgz"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fs-ext_1.2.1_1529335434765_0.7067557141892411"},"_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":1529335434870,"_cnpm_publish_time":1529335434870,"dist-tags":{"latest":"2.1.1"}}