Socket
Socket
Sign inDemoInstall

walk-sync

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

walk-sync - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

.travis.yml

4

CHANGELOG.md
# master
# 0.1.2
* Sort readdir entries for deterministic behavior
# 0.1.1

@@ -4,0 +8,0 @@

2

index.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc