{"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.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.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":"f8b36df429de1a9879001e7e562938663a23960d","_id":"fs-ext@1.2.0","_npmVersion":"5.6.0","_nodeVersion":"9.3.0","_npmUser":{"name":"msergeant","email":"helpme@gmail.com"},"maintainers":[{"name":"msergeant","email":"helpme@gmail.com"}],"dist":{"integrity":"sha512-0VREwVV8qLlZBzoefy76O03XIgO8BUhNS0UbpaO0fodke7JIalMNww99NQ4ba5XApwME06JVH+6qLPLYIfzC1A==","shasum":"1ffe4baa4dd6f0c5ff1e16bac71d8ebb153219fa","tarball":"http://registry-npm.ywwl.com/fs-ext/download/fs-ext-1.2.0.tgz","fileCount":18,"unpackedSize":77773,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbIvRvCRA9TVsSAnZWagAAfnQP/A31drGx/CmPOCU0I/cU\nDwFjUeU1NzA33yQDXKv8+A/2LsSdwSZuajgogEX/fJh03iwNQC0yzs+hGoEE\nPgfLCfdhRNzCwos8YJj/NrKZQSAtr8ZAuX+mgqDwWJ0BX9eoXeT/n2bSQWPu\nioyI2V49Arjr5G+/e5ygWigVPRPxoiHRKosn9LMQnrC4RfBwQUdKI7FkQCxF\nb47PMvj3DR2ZAO5aGXLe3O6HzG01JwDsnb+R8MP/AvNMPtL8HJhh5oxmwJCa\n1TJrCyo58TUSEA22u37pQCaJi4LA5FL9A7c9h83LofVyI/nlSRPbf64EErYh\nh8NFkRQ3spD9UI1ZVBlLld4vK0wwfSPMVoio/bto09tP12RNQjxXjfFSBsQ7\ncMv62+g16RSAEYb+jDZJaCIr2fiFBufXnWoIV6N9Sh82CLEbumtKpGW2LoZf\nFEK3mHIgaeqRxrZiC6+ni/aDEQ68wWzYBvBZSqH6MxsSj6dFSTYLZav43Hmn\nuHjUN5NMr4ZbwpFkn/Lq+tJ74obHjItQZ9Poe6j/aOh1RU1bm9SXaC9DzT61\nlKh5ylmVJ9+vTE71UdDQLr4Pt+2kcvWytQ/4ZFZsjNYQZy/9g1Gf/9qdeQJl\nhka/pH7TbZLTI25Wi+PAXV7r8k5extdpNEKdDFqm27DGO63x5sMNB3pkqyUj\ncNat\r\n=PFBD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDEUIjpZERyqBOLvcqO5u7HDVwATVrZQHgatenpSFENJQIhANGVHbAj5yChxb4mx7vW5ut32f2oqOlllzgWNpht46Jo"}],"size":14626,"noattachment":false,"key":"/fs-ext/-/fs-ext-1.2.0.tgz"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fs-ext_1.2.0_1529017454190_0.15361186621584055"},"_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":1529017454299,"_cnpm_publish_time":1529017454299,"dist-tags":{"latest":"2.1.1"}}