diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..05ade97 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +node_modules +npm-debug.log +.idea diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..a85a94a --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License + +Copyright (c) 2010 Ryan McGrath + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/fonts/OpenSans-Bold-webfont.eot b/fonts/OpenSans-Bold-webfont.eot deleted file mode 100644 index e1c7674..0000000 Binary files a/fonts/OpenSans-Bold-webfont.eot and /dev/null differ diff --git a/fonts/OpenSans-Bold-webfont.svg b/fonts/OpenSans-Bold-webfont.svg deleted file mode 100644 index 364b368..0000000 --- a/fonts/OpenSans-Bold-webfont.svg +++ /dev/null @@ -1,146 +0,0 @@ - - - \ No newline at end of file diff --git a/fonts/OpenSans-Bold-webfont.ttf b/fonts/OpenSans-Bold-webfont.ttf deleted file mode 100644 index 2d94f06..0000000 Binary files a/fonts/OpenSans-Bold-webfont.ttf and /dev/null differ diff --git a/fonts/OpenSans-Bold-webfont.woff b/fonts/OpenSans-Bold-webfont.woff deleted file mode 100644 index cd86852..0000000 Binary files a/fonts/OpenSans-Bold-webfont.woff and /dev/null differ diff --git a/fonts/OpenSans-BoldItalic-webfont.eot b/fonts/OpenSans-BoldItalic-webfont.eot deleted file mode 100644 index f44ac9a..0000000 Binary files a/fonts/OpenSans-BoldItalic-webfont.eot and /dev/null differ diff --git a/fonts/OpenSans-BoldItalic-webfont.svg b/fonts/OpenSans-BoldItalic-webfont.svg deleted file mode 100644 index 8392240..0000000 --- a/fonts/OpenSans-BoldItalic-webfont.svg +++ /dev/null @@ -1,146 +0,0 @@ - - - \ No newline at end of file diff --git a/fonts/OpenSans-BoldItalic-webfont.ttf b/fonts/OpenSans-BoldItalic-webfont.ttf deleted file mode 100644 index f74e0e3..0000000 Binary files a/fonts/OpenSans-BoldItalic-webfont.ttf and /dev/null differ diff --git a/fonts/OpenSans-BoldItalic-webfont.woff b/fonts/OpenSans-BoldItalic-webfont.woff deleted file mode 100644 index f3248c1..0000000 Binary files a/fonts/OpenSans-BoldItalic-webfont.woff and /dev/null differ diff --git a/fonts/OpenSans-Italic-webfont.eot b/fonts/OpenSans-Italic-webfont.eot deleted file mode 100644 index 277c189..0000000 Binary files a/fonts/OpenSans-Italic-webfont.eot and /dev/null differ diff --git a/fonts/OpenSans-Italic-webfont.svg b/fonts/OpenSans-Italic-webfont.svg deleted file mode 100644 index 29c7497..0000000 --- a/fonts/OpenSans-Italic-webfont.svg +++ /dev/null @@ -1,146 +0,0 @@ - - - \ No newline at end of file diff --git a/fonts/OpenSans-Italic-webfont.ttf b/fonts/OpenSans-Italic-webfont.ttf deleted file mode 100644 index 63f187e..0000000 Binary files a/fonts/OpenSans-Italic-webfont.ttf and /dev/null differ diff --git a/fonts/OpenSans-Italic-webfont.woff b/fonts/OpenSans-Italic-webfont.woff deleted file mode 100644 index 469a29b..0000000 Binary files a/fonts/OpenSans-Italic-webfont.woff and /dev/null differ diff --git a/fonts/OpenSans-Light-webfont.eot b/fonts/OpenSans-Light-webfont.eot deleted file mode 100644 index 837daab..0000000 Binary files a/fonts/OpenSans-Light-webfont.eot and /dev/null differ diff --git a/fonts/OpenSans-Light-webfont.svg b/fonts/OpenSans-Light-webfont.svg deleted file mode 100644 index bdb6726..0000000 --- a/fonts/OpenSans-Light-webfont.svg +++ /dev/null @@ -1,146 +0,0 @@ - - - \ No newline at end of file diff --git a/fonts/OpenSans-Light-webfont.ttf b/fonts/OpenSans-Light-webfont.ttf deleted file mode 100644 index b50ef9d..0000000 Binary files a/fonts/OpenSans-Light-webfont.ttf and /dev/null differ diff --git a/fonts/OpenSans-Light-webfont.woff b/fonts/OpenSans-Light-webfont.woff deleted file mode 100644 index 99514d1..0000000 Binary files a/fonts/OpenSans-Light-webfont.woff and /dev/null differ diff --git a/fonts/OpenSans-LightItalic-webfont.eot b/fonts/OpenSans-LightItalic-webfont.eot deleted file mode 100644 index f0ebf2c..0000000 Binary files a/fonts/OpenSans-LightItalic-webfont.eot and /dev/null differ diff --git a/fonts/OpenSans-LightItalic-webfont.svg b/fonts/OpenSans-LightItalic-webfont.svg deleted file mode 100644 index 60765da..0000000 --- a/fonts/OpenSans-LightItalic-webfont.svg +++ /dev/null @@ -1,146 +0,0 @@ - - - \ No newline at end of file diff --git a/fonts/OpenSans-LightItalic-webfont.ttf b/fonts/OpenSans-LightItalic-webfont.ttf deleted file mode 100644 index 5898c8c..0000000 Binary files a/fonts/OpenSans-LightItalic-webfont.ttf and /dev/null differ diff --git a/fonts/OpenSans-LightItalic-webfont.woff b/fonts/OpenSans-LightItalic-webfont.woff deleted file mode 100644 index 9c978dc..0000000 Binary files a/fonts/OpenSans-LightItalic-webfont.woff and /dev/null differ diff --git a/fonts/OpenSans-Regular-webfont.eot b/fonts/OpenSans-Regular-webfont.eot deleted file mode 100644 index dd6fd2c..0000000 Binary files a/fonts/OpenSans-Regular-webfont.eot and /dev/null differ diff --git a/fonts/OpenSans-Regular-webfont.svg b/fonts/OpenSans-Regular-webfont.svg deleted file mode 100644 index 01038bb..0000000 --- a/fonts/OpenSans-Regular-webfont.svg +++ /dev/null @@ -1,146 +0,0 @@ - - - \ No newline at end of file diff --git a/fonts/OpenSans-Regular-webfont.ttf b/fonts/OpenSans-Regular-webfont.ttf deleted file mode 100644 index 05951e7..0000000 Binary files a/fonts/OpenSans-Regular-webfont.ttf and /dev/null differ diff --git a/fonts/OpenSans-Regular-webfont.woff b/fonts/OpenSans-Regular-webfont.woff deleted file mode 100644 index 274664b..0000000 Binary files a/fonts/OpenSans-Regular-webfont.woff and /dev/null differ diff --git a/fonts/OpenSans-Semibold-webfont.eot b/fonts/OpenSans-Semibold-webfont.eot deleted file mode 100644 index 289aade..0000000 Binary files a/fonts/OpenSans-Semibold-webfont.eot and /dev/null differ diff --git a/fonts/OpenSans-Semibold-webfont.svg b/fonts/OpenSans-Semibold-webfont.svg deleted file mode 100644 index cc2ca42..0000000 --- a/fonts/OpenSans-Semibold-webfont.svg +++ /dev/null @@ -1,146 +0,0 @@ - - - \ No newline at end of file diff --git a/fonts/OpenSans-Semibold-webfont.ttf b/fonts/OpenSans-Semibold-webfont.ttf deleted file mode 100644 index 6f15073..0000000 Binary files a/fonts/OpenSans-Semibold-webfont.ttf and /dev/null differ diff --git a/fonts/OpenSans-Semibold-webfont.woff b/fonts/OpenSans-Semibold-webfont.woff deleted file mode 100644 index 4e47cb1..0000000 Binary files a/fonts/OpenSans-Semibold-webfont.woff and /dev/null differ diff --git a/fonts/OpenSans-SemiboldItalic-webfont.eot b/fonts/OpenSans-SemiboldItalic-webfont.eot deleted file mode 100644 index 50a8a6f..0000000 Binary files a/fonts/OpenSans-SemiboldItalic-webfont.eot and /dev/null differ diff --git a/fonts/OpenSans-SemiboldItalic-webfont.svg b/fonts/OpenSans-SemiboldItalic-webfont.svg deleted file mode 100644 index 65b50e2..0000000 --- a/fonts/OpenSans-SemiboldItalic-webfont.svg +++ /dev/null @@ -1,146 +0,0 @@ - - - \ No newline at end of file diff --git a/fonts/OpenSans-SemiboldItalic-webfont.ttf b/fonts/OpenSans-SemiboldItalic-webfont.ttf deleted file mode 100644 index 55ba312..0000000 Binary files a/fonts/OpenSans-SemiboldItalic-webfont.ttf and /dev/null differ diff --git a/fonts/OpenSans-SemiboldItalic-webfont.woff b/fonts/OpenSans-SemiboldItalic-webfont.woff deleted file mode 100644 index 0adc6df..0000000 Binary files a/fonts/OpenSans-SemiboldItalic-webfont.woff and /dev/null differ diff --git a/images/bullet.png b/images/bullet.png deleted file mode 100644 index 22ea543..0000000 Binary files a/images/bullet.png and /dev/null differ diff --git a/images/hr.gif b/images/hr.gif deleted file mode 100644 index bdb4168..0000000 Binary files a/images/hr.gif and /dev/null differ diff --git a/images/nav-bg.gif b/images/nav-bg.gif deleted file mode 100644 index 4743965..0000000 Binary files a/images/nav-bg.gif and /dev/null differ diff --git a/index.html b/index.html deleted file mode 100644 index bb9287b..0000000 --- a/index.html +++ /dev/null @@ -1,151 +0,0 @@ - - -
- - -Recursive file operations in Node.js
-While I love Node.js, I've found myself missing some functions. Things like -recursively deleting/chmodding a directory (or even deep copying a directory), -or even a basic line reader, shouldn't need to be re-invented time and time again.
- -That said, here's my attempt at a re-usable solution, at least until something -more formalized gets integrated into Node.js (*hint hint*). wrench.js is fairly simple -to use - check out the documentation/examples below:
- -In previous versions of Wrench, we went against the OS-default behavior of not -deleting a directory unless the operation is forced. In 1.5.0, this has been -changed to be the behavior people expect there to be - if you try to copy over -a directory that already exists, you'll get an Error returned or thrown stating -that you need to force it.
- -Something like this will do the trick:
- -wrench.copyDirSyncRecursive('directory_to_copy', 'location_where_copy_should_end_up', {
- forceDelete: true
-});
-If you desire the older behavior of Wrench... hit up your package.json. If you -happen to find bugs in the 1.5.0 release please feel free to file them on the -GitHub issues tracker for this project, or send me a pull request and I'll get to -it as fast as I can. Thanks!
- -If this breaks enough projects I will consider rolling it back. Please hit me up if this seems to be the case.
- -npm install wrench
-
-
-var wrench = require('wrench'),
- util = require('util');
-// Recursively create directories, sub-trees and all.
-wrench.mkdirSyncRecursive(dir, 0777);
-
-// Recursively delete the entire sub-tree of a directory, then kill the directory
-wrench.rmdirSyncRecursive('my_directory_name', failSilently);
-
-// Recursively read directories contents.
-wrench.readdirSyncRecursive('my_directory_name');
-
-// Recursively chmod the entire sub-tree of a directory
-wrench.chmodSyncRecursive('my_directory_name', 0755);
-
-// Recursively chown the entire sub-tree of a directory
-wrench.chownSyncRecursive("directory", uid, gid);
-
-// Deep-copy an existing directory
-wrench.copyDirSyncRecursive('directory_to_copy', 'location_where_copy_should_end_up', {
- forceDelete: bool, // Whether to overwrite existing directory or not
- excludeHiddenUnix: bool, // Whether to copy hidden Unix files or not (preceding .)
- preserveFiles: bool, // If we're overwriting something and the file already exists, keep the existing
- inflateSymlinks: bool, // Whether to follow symlinks or not when copying files
- filter: regexp, // A filter to match files against; if matches, do nothing (exclude).
- whitelist: bool, // if true every file or directory which doesn't match filter will be ignored
-});
-
-// Read lines in from a file until you hit the end
-var f = new wrench.LineReader('x.txt');
-while(f.hasNextLine()) {
- util.puts(f.getNextLine());
-}
-
-// Note: You will need to close that above line reader at some point, otherwise
-// you will run into a "too many open files" error. f.close() or fs.closeSync(f.fd) are
-// your friends, as only you know when it is safe to close.
-// Recursively read directories contents
-var files = [];
-wrench.readdirRecursive('my_directory_name', function(error, curFiles) {
- // curFiles is what you want
-});
-
-// If you're feeling somewhat masochistic
-wrench.copyDirRecursive(srcDir, newDir, {forceDelete: bool /* See sync version */}, callbackfn);
-Questions, comments? Hit me up. (ryan [at] venodesigns.net | http://twitter.com/ryanmcgrath)
-