mirror of
https://github.com/jprichardson/node-fs-extra.git
synced 2026-01-25 16:42:57 +00:00
Node.js: fs-extra
-------------------
This module simply patches the Node.js 'fs' object with extra methods.
Installation
~~~~~~~~~~~~
----
npm install fs-extra
----
Make sure that you run the test script to verify that it works on your system.
----
#Mac OS X or Linux Users:
TEST_fs-extra
#Windows Users:
coffee TEST_fs-extra
----
Usage
~~~~~
----
fs = require('fs-extra')
----
Note that you can still use all of the http://nodejs.org/docs/latest/api/fs.html[vanilla Node.js file methods].
Methods:
[source,javascript]
----
fs.copyFileSync(srcFile, destFile) //synchronously copies a file
fs.copyFile(srcFile, destFile, function(err)) //asynchronously copies a file
fs.rmrfSync(dir) //recursively deletes directory, like rm -rf on Unix
fs.rmrf(dir, callback) //asynchronous version as before
----
License
~~~~~~~
(The MIT License)
Copyright (c) 2011 JP Richardson
Languages
JavaScript
100%