{
  "name": "fs-extra",
  "version": "2.1.2",
  "description": "fs-extra contains methods that aren't included in the vanilla Node.js fs package. Such as mkdir -p, cp -r, and rm -rf.",
  "homepage": "https://github.com/jprichardson/node-fs-extra",
  "repository": {
    "type": "git",
    "url": "https://github.com/jprichardson/node-fs-extra"
  },
  "keywords": [
    "fs",
    "file",
    "file system",
    "copy",
    "directory",
    "extra",
    "mkdirp",
    "mkdir",
    "mkdirs",
    "recursive",
    "json",
    "read",
    "write",
    "extra",
    "delete",
    "remove",
    "touch",
    "create",
    "text",
    "output",
    "move"
  ],
  "author": {
    "name": "JP Richardson",
    "email": "jprichardson@gmail.com"
  },
  "license": "MIT",
  "dependencies": {
    "graceful-fs": "^4.1.2",
    "jsonfile": "^2.1.0"
  },
  "devDependencies": {
    "coveralls": "^2.11.2",
    "istanbul": "^0.4.5",
    "klaw": "^1.0.0",
    "klaw-sync": "^1.1.2",
    "minimist": "^1.1.1",
    "mocha": "^3.1.2",
    "proxyquire": "^1.7.10",
    "read-dir-files": "^0.1.1",
    "rimraf": "^2.2.8",
    "secure-random": "^1.1.1",
    "standard": "^8.5.0"
  },
  "main": "./lib/index",
  "scripts": {
    "coverage": "istanbul cover -i 'lib/**' -x '**/__tests__/**' test.js",
    "coveralls": "npm run coverage && coveralls < coverage/lcov.info",
    "lint": "standard",
    "test-find": "find ./lib/**/__tests__ -name *.test.js | xargs mocha",
    "test": "npm run lint && npm run unit",
    "unit": "node test.js"
  },
  "readme": "Node.js: fs-extra\n=================\n\n`fs-extra` adds file system methods that aren't included in the native `fs` module. It is a drop in replacement for `fs`.\n\n[![npm Package](https://img.shields.io/npm/v/fs-extra.svg?style=flat-square)](https://www.npmjs.org/package/fs-extra)\n[![build status](https://api.travis-ci.org/jprichardson/node-fs-extra.svg)](http://travis-ci.org/jprichardson/node-fs-extra)\n[![windows Build status](https://img.shields.io/appveyor/ci/jprichardson/node-fs-extra/master.svg?label=windows%20build)](https://ci.appveyor.com/project/jprichardson/node-fs-extra/branch/master)\n[![downloads per month](http://img.shields.io/npm/dm/fs-extra.svg)](https://www.npmjs.org/package/fs-extra)\n[![Coverage Status](https://img.shields.io/coveralls/jprichardson/node-fs-extra.svg)](https://coveralls.io/r/jprichardson/node-fs-extra)\n\n<a href=\"https://github.com/feross/standard\"><img src=\"https://cdn.rawgit.com/feross/standard/master/sticker.svg\" alt=\"Standard JavaScript\" width=\"100\"></a>\n\n\nWhy?\n----\n\nI got tired of including `mkdirp`, `rimraf`, and `ncp` in most of my projects.\n\n\n\n\nInstallation\n------------\n\n    npm install --save fs-extra\n\n\n\nUsage\n-----\n\n`fs-extra` is a drop in replacement for native `fs`. All methods in `fs` are unmodified and attached to `fs-extra`.\n\nYou don't ever need to include the original `fs` module again:\n\n```js\nconst fs = require('fs') // this is no longer necessary\n```\n\nyou can now do this:\n\n```js\nconst fs = require('fs-extra')\n```\n\nor if you prefer to make it clear that you're using `fs-extra` and not `fs`, you may want\nto name your `fs` variable `fse` like so:\n\n```js\nconst fse = require('fs-extra')\n```\n\nyou can also keep both, but it's redundant:\n\n```js\nconst fs = require('fs')\nconst fse = require('fs-extra')\n```\n\nSync vs Async\n-------------\nMost methods are async by default (they take a callback with an `Error` as first argument).\n\nSync methods on the other hand will throw if an error occurs.\n\nExample:\n\n```js\nconst fs = require('fs-extra')\n\nfs.copy('/tmp/myfile', '/tmp/mynewfile', err => {\n  if (err) return console.error(err)\n  console.log(\"success!\")\n});\n\ntry {\n  fs.copySync('/tmp/myfile', '/tmp/mynewfile')\n  console.log(\"success!\")\n} catch (err) {\n  console.error(err)\n}\n```\n\n\nMethods\n-------\n\n### Async\n\n- [copy](docs/copy.md)\n- [emptyDir](docs/emptyDir.md)\n- [ensureFile](docs/ensureFile.md)\n- [ensureDir](docs/ensureDir.md)\n- [ensureLink](docs/ensureLink.md)\n- [ensureSymlink](docs/ensureSymlink.md)\n- [mkdirs](docs/ensureDir.md)\n- [move](docs/move.md)\n- [outputFile](docs/outputFile.md)\n- [outputJson](docs/outputJson.md)\n- [readJson](docs/readJson.md)\n- [remove](docs/remove.md)\n- [writeJson](docs/writeJson.md)\n\n### Sync\n\n- [copySync](docs/copy-sync.md)\n- [emptyDirSync](docs/emptyDir-sync.md)\n- [ensureFileSync](docs/ensureFile-sync.md)\n- [ensureDirSync](docs/ensureDir-sync.md)\n- [ensureLinkSync](docs/ensureLink-sync.md)\n- [ensureSymlinkSync](docs/ensureSymlink-sync.md)\n- [mkdirsSync](docs/ensureDir-sync.md)\n- [moveSync](docs/move-sync.md)\n- [outputFileSync](docs/outputFile-sync.md)\n- [outputJsonSync](docs/outputJson-sync.md)\n- [readJsonSync](docs/readJson-sync.md)\n- [removeSync](docs/remove-sync.md)\n- [writeJsonSync](docs/writeJson-sync.md)\n\n\n**NOTE:** You can still use the native Node.js methods. They are copied over to `fs-extra`.\n\n### What happened to `walk()` and `walkSync()`?\n\nThey were removed from `fs-extra` in v2.0.0. If you need the functionality, `walk` and `walkSync` are available as separate packages, [`klaw`](https://github.com/jprichardson/node-klaw) and [`klaw-sync`](https://github.com/manidlou/node-klaw-sync).\n\n\nThird Party\n-----------\n\n### Promises\n\nUse [Bluebird](https://github.com/petkaantonov/bluebird). See https://github.com/petkaantonov/bluebird/blob/master/API.md#promisification. `fs-extra` is\nexplicitly listed as supported.\n\n```js\nconst Promise = require('bluebird')\nconst fs = Promise.promisifyAll(require('fs-extra'))\n```\n\nOr you can use a dedicated package:\n\n- [`fs-extra-promise`](https://github.com/overlookmotel/fs-extra-promise) uses Bluebird.\n- [`fs-promise`](https://github.com/kevinbeaty/fs-promise) uses\n  [Any Promise](https://github.com/kevinbeaty/any-promise) and also covers\n  [`mz/fs`](https://github.com/normalize/mz/blob/master/fs.js).\n- [`fs-p`](https://github.com/grammarly/fs-p) - TypeScript-friendly promises implementation\n\n\n### TypeScript\n\nIf you like TypeScript, you can use `fs-extra` with it: https://github.com/borisyankov/DefinitelyTyped/tree/master/fs-extra\n\n\n### File / Directory Watching\n\nIf you want to watch for changes to files or directories, then you should use [chokidar](https://github.com/paulmillr/chokidar).\n\n\n### Misc.\n\n- [mfs](https://github.com/cadorn/mfs) - Monitor your fs-extra calls.\n\n\n\nHacking on fs-extra\n-------------------\n\nWanna hack on `fs-extra`? Great! Your help is needed! [fs-extra is one of the most depended upon Node.js packages](http://nodei.co/npm/fs-extra.png?downloads=true&downloadRank=true&stars=true). This project\nuses [JavaScript Standard Style](https://github.com/feross/standard) - if the name or style choices bother you,\nyou're gonna have to get over it :) If `standard` is good enough for `npm`, it's good enough for `fs-extra`.\n\n[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)\n\nWhat's needed?\n- First, take a look at existing issues. Those are probably going to be where the priority lies.\n- More tests for edge cases. Specifically on different platforms. There can never be enough tests.\n- Improve test coverage. See coveralls output for more info.\n\nNote: If you make any big changes, **you should definitely file an issue for discussion first.**\n\n### Running the Test Suite\n\nfs-extra contains hundreds of tests.\n\n- `npm run lint`: runs the linter ([standard](http://standardjs.com/))\n- `npm run unit`: runs the unit tests\n- `npm test`: runs both the linter and the tests\n\n\n### Windows\n\nIf you run the tests on the Windows and receive a lot of symbolic link `EPERM` permission errors, it's\nbecause on Windows you need elevated privilege to create symbolic links. You can add this to your Windows's\naccount by following the instructions here: http://superuser.com/questions/104845/permission-to-make-symbolic-links-in-windows-7\nHowever, I didn't have much luck doing this.\n\nSince I develop on Mac OS X, I use VMWare Fusion for Windows testing. I create a shared folder that I map to a drive on Windows.\nI open the `Node.js command prompt` and run as `Administrator`. I then map the network drive running the following command:\n\n    net use z: \"\\\\vmware-host\\Shared Folders\"\n\nI can then navigate to my `fs-extra` directory and run the tests.\n\n\nNaming\n------\n\nI put a lot of thought into the naming of these functions. Inspired by @coolaj86's request. So he deserves much of the credit for raising the issue. See discussion(s) here:\n\n* https://github.com/jprichardson/node-fs-extra/issues/2\n* https://github.com/flatiron/utile/issues/11\n* https://github.com/ryanmcgrath/wrench-js/issues/29\n* https://github.com/substack/node-mkdirp/issues/17\n\nFirst, I believe that in as many cases as possible, the [Node.js naming schemes](http://nodejs.org/api/fs.html) should be chosen. However, there are problems with the Node.js own naming schemes.\n\nFor example, `fs.readFile()` and `fs.readdir()`: the **F** is capitalized in *File* and the **d** is not capitalized in *dir*. Perhaps a bit pedantic, but they should still be consistent. Also, Node.js has chosen a lot of POSIX naming schemes, which I believe is great. See: `fs.mkdir()`, `fs.rmdir()`, `fs.chown()`, etc.\n\nWe have a dilemma though. How do you consistently name methods that perform the following POSIX commands: `cp`, `cp -r`, `mkdir -p`, and `rm -rf`?\n\nMy perspective: when in doubt, err on the side of simplicity. A directory is just a hierarchical grouping of directories and files. Consider that for a moment. So when you want to copy it or remove it, in most cases you'll want to copy or remove all of its contents. When you want to create a directory, if the directory that it's suppose to be contained in does not exist, then in most cases you'll want to create that too.\n\nSo, if you want to remove a file or a directory regardless of whether it has contents, just call `fs.remove(path)`. If you want to copy a file or a directory whether it has contents, just call `fs.copy(source, destination)`. If you want to create a directory regardless of whether its parent directories exist, just call `fs.mkdirs(path)` or `fs.mkdirp(path)`.\n\n\nCredit\n------\n\n`fs-extra` wouldn't be possible without using the modules from the following authors:\n\n- [Isaac Shlueter](https://github.com/isaacs)\n- [Charlie McConnel](https://github.com/avianflu)\n- [James Halliday](https://github.com/substack)\n- [Andrew Kelley](https://github.com/andrewrk)\n\n\n\n\nLicense\n-------\n\nLicensed under MIT\n\nCopyright (c) 2011-2017 [JP Richardson](https://github.com/jprichardson)\n\n[1]: http://nodejs.org/docs/latest/api/fs.html\n\n\n[jsonfile]: https://github.com/jprichardson/node-jsonfile\n",
  "readmeFilename": "README.md",
  "bugs": {
    "url": "https://github.com/jprichardson/node-fs-extra/issues"
  },
  "_id": "fs-extra@2.1.2",
  "_shasum": "046c70163cef9aad46b0e4a7fa467fb22d71de35",
  "_from": "fs-extra@^2.0.0",
  "_resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-2.1.2.tgz"
}
