diff --git a/LICENSE.mkd b/LICENSE similarity index 95% rename from LICENSE.mkd rename to LICENSE index 83383f2..b797b56 100644 --- a/LICENSE.mkd +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright © 2011-2012 Paul Vorbach +Copyright © 2011-2012 Paul Vorbach 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 diff --git a/README.mkd b/README.md similarity index 55% rename from README.mkd rename to README.md index 17c16f4..d39e0b6 100644 --- a/README.mkd +++ b/README.md @@ -1,18 +1,19 @@ # dive + a tiny module for node that is able to recursively walk (_„dive“_) a directory tree. **dive** is the asynchronous version of [diveSync](//github.com/pvorb/node-diveSync). -```js +~~~ javascript dive(directory[, options], action[, complete]); -``` +~~~ * `directory` is the pathname of a readable directory. * `options` [optional] is an object that defines some of the properties. The default options are as follows: - ```js + ~~~ javascript { recursive: true, // - If set to false, this will ignore subdirectories. all: false, // - If set to true, this will show "dot files" and @@ -23,7 +24,7 @@ dive(directory[, options], action[, complete]); files: true // - If set to false, this won't call `action` on // files any more. } - ``` + ~~~ * `action` is passed two arguments `(err, file)` where `err` is an error or `null` and `file` is the pathname of a file. * `complete [optional]` may define a second callback, that is called, when all @@ -31,24 +32,23 @@ dive(directory[, options], action[, complete]); ## Installation -```bash -npm install dive -``` + npm install dive ## Usage Default: -```js +~~~ javascript var dive = require('dive'); dive(process.cwd(), function(err, file) { }); +~~~ All files and a callback in the end: -```js +~~~ javascript var dive = require('dive'); dive(process.cwd(), { all: true }, function(err, file) { @@ -57,25 +57,45 @@ dive(process.cwd(), { all: true }, function(err, file) { }, function() { console.log('complete'); }); -``` +~~~ Directories only: -```js +~~~ javascript var dive = require('dive'); dive(process.cwd(), { directories: true, files: false }, function(err, dir) { if (err) throw err; console.log(dir); }); -``` +~~~ ## Bugs and Issues -If you encounter any bugs or issues, feel free to open an issue at -[github](//github.com/pvorb/node-dive/issues). +If you encounter any bugs or issues, feel free to +[open an issue at github](//github.com/pvorb/node-dive/issues) or send me an +email to . I also always like to hear from you, if you’re using my +code. ## License -This package is licensed under the -[MIT license](http://vorb.de/license/mit.html). +(The MIT License) + +Copyright © 2011-2012 Paul Vorbach + +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, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.