Comparing version 0.1.1 to 0.1.2
# master | ||
# 0.1.2 | ||
* Sort readdir entries for deterministic behavior | ||
# 0.1.1 | ||
@@ -4,0 +8,0 @@ |
@@ -14,3 +14,3 @@ var fs = require('fs') | ||
var results = [] | ||
var entries = fs.readdirSync(baseDir + '/' + relativePath) | ||
var entries = fs.readdirSync(baseDir + '/' + relativePath).sort() | ||
for (var i = 0; i < entries.length; i++) { | ||
@@ -17,0 +17,0 @@ var stats = fs.lstatSync(baseDir + '/' + relativePath + entries[i]) |
{ | ||
"name": "walk-sync", | ||
"description": "Get an array of recursive directory contents", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"author": "Jo Liss <joliss42@gmail.com>", | ||
@@ -6,0 +6,0 @@ "main": "index.js", |
# node-walk-sync | ||
[![Build Status](https://travis-ci.org/joliss/node-walk-sync.png?branch=master)](https://travis-ci.org/joliss/node-walk-sync) | ||
Return an array containing all recursive files and directories under a given | ||
@@ -32,2 +34,5 @@ directory, similar to Unix `find`. Does not follow symlinks. Bare-bones, but | ||
Symlinks are not followed. They are treated like files, even when they point | ||
to directories. | ||
## Background | ||
@@ -34,0 +39,0 @@ |
@@ -0,1 +1,2 @@ | ||
var fs = require('fs') | ||
var test = require('tap').test | ||
@@ -6,8 +7,7 @@ var walkSync = require('../') | ||
t.deepEqual(walkSync('fixtures'), [ | ||
'dir1/', | ||
'dir1/bar.txt', | ||
'dir1/subdir/', | ||
'dir1/subdir/baz.txt', | ||
'dir1/zzz.txt', | ||
'dir2/', | ||
'dir/', | ||
'dir/bar.txt', | ||
'dir/subdir/', | ||
'dir/subdir/baz.txt', | ||
'dir/zzz.txt', | ||
'foo.txt', | ||
@@ -17,3 +17,18 @@ 'symlink1', | ||
]) | ||
t.throws(function () { | ||
walkSync('doesnotexist') | ||
}, { | ||
name: 'Error', | ||
message: "ENOENT, no such file or directory 'doesnotexist/'" | ||
}) | ||
t.throws(function () { | ||
walkSync('fixtures/foo.txt') | ||
}, { | ||
name: 'Error', | ||
message: "ENOTDIR, not a directory 'fixtures/foo.txt/'" | ||
}) | ||
t.end() | ||
}) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4616
13
51
49
2