{"_id":"ndir","_rev":"1213348","name":"ndir","description":"The lost dir util tools for Nodejs. Handle dir and file in Event","dist-tags":{"latest":"0.1.5"},"maintainers":[{"name":"fengmk2","email":"fengmk2@gmail.com"}],"time":{"modified":"2021-10-13T05:46:44.000Z","created":"2011-12-30T12:10:16.424Z","0.1.5":"2012-09-22T10:19:21.809Z","0.1.4":"2012-06-26T08:08:33.405Z","0.1.3":"2012-03-09T02:27:27.527Z","0.1.2":"2012-02-16T07:42:24.130Z","0.1.1":"2012-01-17T09:31:40.757Z","0.1.0":"2011-12-30T12:10:16.424Z"},"users":{"nuer":true,"jixiangac":true,"tinyhill":true},"author":{"name":"fengmk2","email":"fengmk2@gmail.com","url":"http://github.com/fengmk2"},"repository":{"type":"git","url":"git://github.com/fengmk2/ndir.git"},"versions":{"0.1.5":{"name":"ndir","version":"0.1.5","description":"The lost dir util tools for Nodejs. Handle dir and file in Event","keywords":["dir","mkdir","walk","file","rm","filesystem","event","readfile","linereader"],"author":{"name":"fengmk2","email":"fengmk2@gmail.com","url":"http://github.com/fengmk2"},"homepage":"http://github.com/fengmk2/ndir","main":"index.js","repository":{"type":"git","url":"git://github.com/fengmk2/ndir.git"},"scripts":{"test":"make test"},"dependencies":{},"devDependencies":{"should":">=0.4.2","mocha":">=0.13.0"},"license":"MIT","engines":{"node":">= 0.4"},"_id":"ndir@0.1.5","dist":{"shasum":"120891d7697bbbe8214cfeff09602060d3454558","size":21418,"noattachment":false,"key":"/ndir/-/ndir-0.1.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/ndir/download/ndir-0.1.5.tgz"},"_npmVersion":"1.1.61","_npmUser":{"name":"fengmk2","email":"fengmk2@gmail.com"},"maintainers":[{"name":"fengmk2","email":"fengmk2@gmail.com"}],"directories":{},"publish_time":1348309161809,"_hasShrinkwrap":false,"_cnpm_publish_time":1348309161809},"0.1.4":{"name":"ndir","version":"0.1.4","description":"The lost dir util tools for Nodejs. Handle dir and file in Event","keywords":["dir","mkdir","walk","file","rm","filesystem","event","readfile","linereader"],"author":{"name":"fengmk2","email":"fengmk2@gmail.com","url":"http://github.com/fengmk2"},"homepage":"http://github.com/fengmk2/ndir","main":"index.js","repository":{"type":"git","url":"git://github.com/fengmk2/ndir.git"},"scripts":{"test":"make test"},"dependencies":{},"devDependencies":{"should":">=0.4.2","mocha":">=0.13.0"},"license":"MIT","engines":{"node":">= 0.4"},"_id":"ndir@0.1.4","dist":{"shasum":"abc2c5277ae04562b60b28fcb9040950e51b4aa9","size":21332,"noattachment":false,"key":"/ndir/-/ndir-0.1.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/ndir/download/ndir-0.1.4.tgz"},"maintainers":[{"name":"fengmk2","email":"fengmk2@gmail.com"}],"directories":{},"publish_time":1340698113405,"_hasShrinkwrap":false,"_cnpm_publish_time":1340698113405},"0.1.3":{"name":"ndir","version":"0.1.3","description":"The lost dir util tools for Nodejs. Handle dir and file in Event","keywords":["dir","mkdir","walk","file","rm","filesystem","event","readfile","linereader"],"author":{"name":"fengmk2","email":"fengmk2@gmail.com","url":"http://github.com/fengmk2"},"homepage":"http://github.com/fengmk2/ndir","main":"index.js","repository":{"type":"git","url":"git://github.com/fengmk2/ndir.git"},"scripts":{"test":"make test"},"dependencies":{},"devDependencies":{"should":">=0.4.2","mocha":">=0.13.0"},"license":"MIT","engines":{"node":">= 0.6.0"},"_npmUser":{"name":"fengmk2","email":"fengmk2@gmail.com"},"_id":"ndir@0.1.3","optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.1","_nodeVersion":"v0.6.11","_defaultsLoaded":true,"dist":{"shasum":"da085e8cec254d605e1c1db5bfadd08289f5a741","size":20873,"noattachment":false,"key":"/ndir/-/ndir-0.1.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/ndir/download/ndir-0.1.3.tgz"},"maintainers":[{"name":"fengmk2","email":"fengmk2@gmail.com"}],"directories":{},"publish_time":1331260047527,"_hasShrinkwrap":false,"_cnpm_publish_time":1331260047527},"0.1.2":{"name":"ndir","version":"0.1.2","description":"The lost dir util tools for Nodejs. Handle dir and file in Event","keywords":["dir","mkdir","walk","file","rm","filesystem","event","readfile","linereader"],"author":{"name":"fengmk2","email":"fengmk2@gmail.com","url":"http://github.com/fengmk2"},"homepage":"http://github.com/fengmk2/ndir","main":"./lib/ndir.js","repository":{"type":"git","url":"git://github.com/fengmk2/ndir.git"},"scripts":{"test":"make test"},"dependencies":{},"devDependencies":{"should":">=0.4.2","mocha":">=0.7.1"},"license":"MIT","engines":{"node":">= 0.6.0"},"_npmUser":{"name":"fengmk2","email":"fengmk2@gmail.com"},"_id":"ndir@0.1.2","optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.0-3","_nodeVersion":"v0.6.10","_defaultsLoaded":true,"dist":{"shasum":"9dee8e42a16c2fd08504a6b14ef08c5523e7b0c5","size":20387,"noattachment":false,"key":"/ndir/-/ndir-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/ndir/download/ndir-0.1.2.tgz"},"maintainers":[{"name":"fengmk2","email":"fengmk2@gmail.com"}],"directories":{},"publish_time":1329378144130,"_hasShrinkwrap":false,"_cnpm_publish_time":1329378144130},"0.1.1":{"name":"ndir","version":"0.1.1","description":"The lost dir util tools for Nodejs. Handle dir and file in Event","keywords":["dir","mkdir","walk","file","rm","filesystem","event","readfile","linereader"],"author":{"name":"fengmk2","email":"fengmk2@gmail.com","url":"http://github.com/fengmk2"},"main":"./lib/ndir.js","repository":{"type":"git","url":"git://github.com/fengmk2/ndir.git"},"scripts":{"test":"make test"},"dependencies":{},"devDependencies":{"should":">=0.4.2","mocha":">=0.7.1"},"license":"MIT","engines":{"node":">= 0.6.0"},"_npmUser":{"name":"fengmk2","email":"fengmk2@gmail.com"},"_id":"ndir@0.1.1","_engineSupported":true,"_npmVersion":"1.1.0-beta-10","_nodeVersion":"v0.6.7","_defaultsLoaded":true,"dist":{"shasum":"d4cb58bd59ad7e0d559899b2f246dd24107d6619","size":6698,"noattachment":false,"key":"/ndir/-/ndir-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/ndir/download/ndir-0.1.1.tgz"},"maintainers":[{"name":"fengmk2","email":"fengmk2@gmail.com"}],"directories":{},"publish_time":1326792700757,"_hasShrinkwrap":false,"_cnpm_publish_time":1326792700757},"0.1.0":{"name":"ndir","version":"0.1.0","description":"The lost dir util tools for Nodejs. Handle dir and file in Event","keywords":["dir","mkdir","walk","file","rm","filesystem","event"],"author":{"name":"fengmk2","email":"fengmk2@gmail.com","url":"http://github.com/fengmk2"},"main":"./lib/ndir.js","repository":{"type":"git","url":"git://github.com/fengmk2/ndir.git"},"dependencies":{},"devDependencies":{"should":">=0.4.2","mocha":">=0.7.1"},"license":"MIT","engines":{"node":">= 0.6.0 < 0.7.0"},"_npmUser":{"name":"fengmk2","email":"fengmk2@gmail.com"},"_id":"ndir@0.1.0","_engineSupported":true,"_npmVersion":"1.1.0-beta-4","_nodeVersion":"v0.6.6","_defaultsLoaded":true,"dist":{"shasum":"01903616af10af7505e3a5ff8e029edefd7c5895","size":5775,"noattachment":false,"key":"/ndir/-/ndir-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/ndir/download/ndir-0.1.0.tgz"},"maintainers":[{"name":"fengmk2","email":"fengmk2@gmail.com"}],"directories":{},"publish_time":1325247016424,"_hasShrinkwrap":false,"_cnpm_publish_time":1325247016424}},"readme":"# ndir\n\nThe lost dir util tools. Handle dir and file in Event.\n\n## Install\n\n```\n$ npm install ndir\n```\n\nrequire `ndir`\n\n```\nvar ndir = require('ndir');\n```\n\n## Walk dir: ndir.walk()\n\ncallback mode:\n\n```\nndir.walk('./', function onDir(dirpath, files) {\n  console.log(' * %s', dirpath);\n  for (var i = 0, l = files.length; i < l; i++) {\n    var info = files[i];\n    if (info[1].isFile()) {\n      console.log('   * %s', info[0]);\n    }\n  }\n}, function end() {\n  console.log('walk end.');\n}, function error() {\n  console.error('%s error: %s', errPath, err);\n});\n```\n\nevent mode:\n\n```\nvar walker = ndir.walk('./');\nwalker.on('dir', function(dirpath, files) {\n  console.log(' * %s', dirpath);\n  for (var i = 0, l = files.length; i < l; i++) {\n    var info = files[i];\n    if (info[1].isFile()) {\n      console.log('   * %s', info[0]);\n    }\n  }\n});\nwalker.on('error', function(err, errPath) {\n  console.error('%s error: %s', errPath, err);\n});\nwalker.on('end', function() {\n  console.log('walk end.');\n});\n```\n\n## Copy file: ndir.copyfile()\n\nCopy file, auto create target file parent dir if it not exists.\n\n```\nndir.copyfile(fromfile, tofile, function(err) {\n  if (err) {\n    throw err;\n  }\n  consle.log('copy file success.');\n});\n```\n\n## Make dir: ndir.mkdir()\n\nMake dir, equal `$ mkdir -p dirname` .\n\n```\nndir.mkdir(dirname, function(err) {\n  if (err) {\n    throw err;\n  }\n  consle.log('mkdir success.');\n});\n```\n\n## Viewing Examples\n\nFirst install the dev dependencies to install all the example / test suite deps:\n\n    $ npm install -d\n\nthen run whichever tests you want:\n\n    $ node example/listdir.js example\n\n## Running Tests\n\nTo run the test suite first invoke the following command within the repo, installing the development dependencies:\n\n    $ npm install\n\nthen run the tests:\n\n    $ make test\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2011-2012 fengmk2 &lt;fengmk2@gmail.com&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_attachments":{},"homepage":"http://github.com/fengmk2/ndir","license":"MIT"}