Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

scandirectory

Package Overview
Dependencies
Maintainers
2
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

scandirectory - npm Package Compare versions

Comparing version 5.3.0 to 6.0.0-next.1589186605.514bbddd772d25b043dd5d3ebef810f35ac4c0e6

5

HISTORY.md
# History
## v6.0.0 2020 May 11
- Updated dependencies, [base files](https://github.com/bevry/base), and [editions](https://editions.bevry.me) using [boundation](https://github.com/bevry/boundation)
- Minimum required node version changed from `node: >=8` to `node: >=10` to keep up with mandatory ecosystem changes
## v5.3.0 2019 December 10

@@ -4,0 +9,0 @@

2

LICENSE.md

@@ -7,3 +7,3 @@ <!-- LICENSEFILE/ -->

<ul><li>Copyright &copy; 2011+ <a href="http://balupton.com">Benjamin Lupton</a></li>
<ul><li>Copyright &copy; 2011+ <a href="https://balupton.com">Benjamin Lupton</a></li>
<li>Copyright &copy; 2014+ <a href="http://bevry.me">Bevry Pty Ltd</a></li></ul>

@@ -10,0 +10,0 @@

{
"name": "scandirectory",
"version": "5.3.0",
"version": "6.0.0-next.1589186605.514bbddd772d25b043dd5d3ebef810f35ac4c0e6",
"description": "Scan a directory recursively with a lot of control and power",

@@ -8,9 +8,11 @@ "homepage": "https://github.com/bevry/scandirectory",

"keywords": [
"esnext",
"fs",
"node",
"path",
"fs",
"recursive",
"scandir",
"scandirectory",
"scanlist",
"scantree",
"scanlist",
"recursive",
"tree"

@@ -46,15 +48,18 @@ ],

"wishlistURL": "https://bevry.me/wishlist",
"travisTLD": "com"
"travisTLD": "com",
"githubUsername": "bevry",
"githubRepository": "scandirectory",
"githubSlug": "bevry/scandirectory",
"npmPackageName": "scandirectory"
}
},
"funding": "https://bevry.me/fund",
"author": "2011+ Benjamin Lupton <b@lupton.cc> (http://balupton.com), 2014+ Bevry Pty Ltd <us@bevry.me> (http://bevry.me)",
"author": "2011+ Benjamin Lupton <b@lupton.cc> (https://balupton.com), 2014+ Bevry Pty Ltd <us@bevry.me> (http://bevry.me)",
"maintainers": [
"Benjamin Lupton <b@lupton.cc> (http://balupton.com)"
"Benjamin Lupton <b@lupton.cc> (https://github.com/balupton)"
],
"contributors": [
"Benjamin Lupton <b@lupton.cc> (http://balupton.com)",
"Sean Fridman <mail@seanfridman.com> (http://seanfridman.com)",
"Bogdan Lysenko <lysenkobv@gmail.com> (http://www.linkedin.com/in/lysenkobv)",
"dependabot-preview[bot] (http://github.com/apps/dependabot-preview)"
"Benjamin Lupton <b@lupton.cc> (https://github.com/balupton)",
"Bogdan Lysenko <lysenkobv@gmail.com> (https://github.com/lysenkobv)",
"Sean Fridman <mail@seanfridman.com> (https://github.com/sfrdmn)"
],

@@ -69,7 +74,7 @@ "bugs": {

"engines": {
"node": ">=8"
"node": ">=10"
},
"editions": [
{
"description": "esnext source code with require for modules",
"description": "ESNext source code for Node.js with Require for modules",
"directory": "source",

@@ -83,3 +88,3 @@ "entry": "index.js",

"engines": {
"node": "8 || 10 || 12"
"node": "10 || 12 || 13 || 14"
}

@@ -91,15 +96,16 @@ }

"dependencies": {
"ignorefs": "^2.3.0",
"readdir-cluster": "^2.3.0"
"ignorefs": "^3.0.0",
"readdir-cluster": "^3.0.0"
},
"devDependencies": {
"assert-helpers": "^5.8.0",
"eslint": "^6.7.2",
"eslint-config-bevry": "^2.3.0",
"eslint-config-prettier": "^6.7.0",
"eslint-plugin-prettier": "^3.1.1",
"kava": "^4.4.0",
"prettier": "^1.19.1",
"projectz": "^1.16.0",
"valid-directory": "^1.5.0"
"@bevry/update-contributors": "^1.4.0",
"assert-helpers": "^6.2.0",
"eslint": "^7.0.0",
"eslint-config-bevry": "^3.4.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-prettier": "^3.1.3",
"kava": "^5.0.0",
"prettier": "^2.0.5",
"projectz": "^2.1.0",
"valid-directory": "^1.6.0"
},

@@ -110,4 +116,5 @@ "scripts": {

"our:deploy": "echo no need for this project",
"our:meta": "npm run our:meta:projectz",
"our:meta:projectz": "projectz compile",
"our:meta": "npm run our:meta:contributors && npm run our:meta:projectz",
"our:meta:contributors": "npx @bevry/update-contributors",
"our:meta:projectz": "npx projectz compile",
"our:release": "npm run our:release:prepare && npm run our:release:check-changelog && npm run our:release:check-dirty && npm run our:release:tag && npm run our:release:push",

@@ -124,4 +131,4 @@ "our:release:check-changelog": "cat ./HISTORY.md | grep v$npm_package_version || (echo add a changelog entry for v$npm_package_version && exit -1)",

"our:verify:directory": "npx valid-directory",
"our:verify:eslint": "eslint --fix --ignore-pattern '**/*.d.ts' --ignore-pattern '**/vendor/' --ignore-pattern '**/node_modules/' --ext .mjs,.js,.jsx,.ts,.tsx ./source",
"our:verify:prettier": "prettier --write ./source/**",
"our:verify:eslint": "npx eslint --fix --ignore-pattern '**/*.d.ts' --ignore-pattern '**/vendor/' --ignore-pattern '**/node_modules/' --ext .mjs,.js,.jsx,.ts,.tsx ./source",
"our:verify:prettier": "npx prettier --write .",
"test": "node ./source/test.js"

@@ -128,0 +135,0 @@ },

@@ -7,3 +7,2 @@ <!-- TITLE/ -->

<!-- BADGES/ -->

@@ -29,3 +28,2 @@

<!-- DESCRIPTION/ -->

@@ -37,38 +35,15 @@

<!-- INSTALL/ -->
<h2>Install</h2>
<a href="https://npmjs.com" title="npm is a package manager for javascript"><h3>npm</h3></a>
<ul>
<li>Install: <code>npm install --save scandirectory</code></li>
<li>Require: <code>require('scandirectory')</code></li>
</ul>
<h3><a href="https://editions.bevry.me" title="Editions are the best way to produce and consume packages you care about.">Editions</a></h3>
<p>This package is published with the following editions:</p>
<ul><li><code>scandirectory</code> aliases <code>scandirectory/source/index.js</code></li>
<li><code>scandirectory/source/index.js</code> is esnext source code with require for modules</li></ul>
<p>Environments older than Node.js v8 may need <a href="https://babeljs.io/docs/usage/polyfill/" title="A polyfill that emulates missing ECMAScript environment features">Babel's Polyfill</a> or something similar.</p>
<!-- /INSTALL -->
## Usage
``` javascript
```javascript
var scandir = require('scandirectory')
var path = process.cwd()
var options = {}
function completionCallback (err, list, tree) {
console.log({
error: err,
list: list,
tree: tree
})
/*
function completionCallback(err, list, tree) {
console.log({
error: err,
list: list,
tree: tree,
})
/*
{

@@ -95,7 +70,7 @@ error: null,

- `action` - (default `null`) can be `null` or a function to use for both the fileAction and dirAction
- `fileAction` - (default `null`) can be `null`, `false`, or a function to be the action callback
- `dirAction` - (default `null`) can be `null`, `false`, or a function to the action callback
- `recurse` - (default `true`) can be `null` or a boolean for whether or not to scan subdirectories too
- `readFiles` - (default `false`) can be `null` or a boolean for whether or not we should read the file contents
- `action` - (default `null`) can be `null` or a function to use for both the fileAction and dirAction
- `fileAction` - (default `null`) can be `null`, `false`, or a function to be the action callback
- `dirAction` - (default `null`) can be `null`, `false`, or a function to the action callback
- `recurse` - (default `true`) can be `null` or a boolean for whether or not to scan subdirectories too
- `readFiles` - (default `false`) can be `null` or a boolean for whether or not we should read the file contents

@@ -106,8 +81,5 @@ The options object is also sent to [ignorefs](https://github.com/bevry/ignorefs) so you can use its options too

- `err` - `null` or an error that has occured
- `list` - a collection of all the child nodes in a list/object format:
- `{fileRelativePath: 'dir|file'}`
- `tree` - a collection of all the child nodes in a tree format:
- `{dir: {dir:{}, file1:true} }`
- if the readFiles option is true, then files will be returned with their contents instead
- `err` - `null` or an error that has occured
- `list` - a collection of all the child nodes in a list/object format: - `{fileRelativePath: 'dir|file'}`
- `tree` - a collection of all the child nodes in a tree format: - `{dir: {dir:{}, file1:true} }` - if the readFiles option is true, then files will be returned with their contents instead

@@ -118,10 +90,9 @@ The results for a specific argument is only generated if the argument is requested.

- `fullPath` - the full/absolute path of the current file/directory
- `relativePath` - the relative path of the current file/directory with respect to the original scanning path
- `filename` - the basename of the current file/directory
- `stat` - a simple stat object provided by [readdir-cluster](https://github.com/bevry/readdir-cluster)
- `fullPath` - the full/absolute path of the current file/directory
- `relativePath` - the relative path of the current file/directory with respect to the original scanning path
- `filename` - the basename of the current file/directory
- `stat` - a simple stat object provided by [readdir-cluster](https://github.com/bevry/readdir-cluster)
The action callbacks can return `false` to skip the path from being processed further.
<!-- CONTRIBUTE/ -->

@@ -135,3 +106,23 @@

<!-- INSTALL/ -->
<h2>Install</h2>
<a href="https://npmjs.com" title="npm is a package manager for javascript"><h3>npm</h3></a>
<ul>
<li>Install: <code>npm install --save scandirectory</code></li>
<li>Import: <code>import * as pkg from ('scandirectory')</code></li>
<li>Require: <code>const pkg = require('scandirectory')</code></li>
</ul>
<h3><a href="https://editions.bevry.me" title="Editions are the best way to produce and consume packages you care about.">Editions</a></h3>
<p>This package is published with the following editions:</p>
<ul><li><code>scandirectory</code> aliases <code>scandirectory/source/index.js</code></li>
<li><code>scandirectory/source/index.js</code> is <a href="https://en.wikipedia.org/wiki/ECMAScript#ES.Next" title="ECMAScript Next">ESNext</a> source code for <a href="https://nodejs.org" title="Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine">Node.js</a> with <a href="https://nodejs.org/dist/latest-v5.x/docs/api/modules.html" title="Node/CJS Modules">Require</a> for modules</li></ul>
<!-- /INSTALL -->
<!-- HISTORY/ -->

@@ -145,3 +136,2 @@

<!-- BACKERS/ -->

@@ -155,3 +145,3 @@

<ul><li><a href="http://balupton.com">Benjamin Lupton</a> — <a href="https://github.com/bevry/scandirectory/commits?author=balupton" title="View the GitHub contributions of Benjamin Lupton on repository bevry/scandirectory">view contributions</a></li></ul>
<ul><li><a href="https://balupton.com">Benjamin Lupton</a> — <a href="https://github.com/bevry/scandirectory/commits?author=balupton" title="View the GitHub contributions of Benjamin Lupton on repository bevry/scandirectory">view contributions</a></li></ul>

@@ -176,6 +166,5 @@ <h3>Sponsors</h3>

<ul><li><a href="http://balupton.com">Benjamin Lupton</a> — <a href="https://github.com/bevry/scandirectory/commits?author=balupton" title="View the GitHub contributions of Benjamin Lupton on repository bevry/scandirectory">view contributions</a></li>
<li><a href="http://seanfridman.com">Sean Fridman</a> — <a href="https://github.com/bevry/scandirectory/commits?author=sfrdmn" title="View the GitHub contributions of Sean Fridman on repository bevry/scandirectory">view contributions</a></li>
<li><a href="http://www.linkedin.com/in/lysenkobv">Bogdan Lysenko</a> — <a href="https://github.com/bevry/scandirectory/commits?author=lysenkobv" title="View the GitHub contributions of Bogdan Lysenko on repository bevry/scandirectory">view contributions</a></li>
<li><a href="http://github.com/apps/dependabot-preview">dependabot-preview[bot]</a> — <a href="https://github.com/bevry/scandirectory/commits?author=dependabot-preview[bot]" title="View the GitHub contributions of dependabot-preview[bot] on repository bevry/scandirectory">view contributions</a></li></ul>
<ul><li><a href="https://balupton.com">Benjamin Lupton</a> — <a href="https://github.com/bevry/scandirectory/commits?author=balupton" title="View the GitHub contributions of Benjamin Lupton on repository bevry/scandirectory">view contributions</a></li>
<li><a href="https://github.com/lysenkobv">Bogdan Lysenko</a> — <a href="https://github.com/bevry/scandirectory/commits?author=lysenkobv" title="View the GitHub contributions of Bogdan Lysenko on repository bevry/scandirectory">view contributions</a></li>
<li><a href="https://github.com/sfrdmn">Sean Fridman</a> — <a href="https://github.com/bevry/scandirectory/commits?author=sfrdmn" title="View the GitHub contributions of Sean Fridman on repository bevry/scandirectory">view contributions</a></li></ul>

@@ -186,3 +175,2 @@ <a href="https://github.com/bevry/scandirectory/blob/master/CONTRIBUTING.md#files">Discover how you can contribute by heading on over to the <code>CONTRIBUTING.md</code> file.</a>

<!-- LICENSE/ -->

@@ -194,3 +182,3 @@

<ul><li>Copyright &copy; 2011+ <a href="http://balupton.com">Benjamin Lupton</a></li>
<ul><li>Copyright &copy; 2011+ <a href="https://balupton.com">Benjamin Lupton</a></li>
<li>Copyright &copy; 2014+ <a href="http://bevry.me">Bevry Pty Ltd</a></li></ul>

@@ -197,0 +185,0 @@

@@ -19,3 +19,3 @@ /* eslint no-inner-declarations:0 */

const opts = {}
args.forEach(function(arg) {
args.forEach(function (arg) {
switch (typeof arg) {

@@ -29,3 +29,3 @@ case 'string':

case 'object':
Object.keys(arg).forEach(function(key) {
Object.keys(arg).forEach(function (key) {
opts[key] = arg[key]

@@ -43,3 +43,3 @@ })

if (opts.next == null)
opts.next = function(err) {
opts.next = function (err) {
if (err) throw err

@@ -137,3 +137,3 @@ }

// Read
readdir(opts.path, iterator, function(err) {
readdir(opts.path, iterator, function (err) {
if (err) {

@@ -149,3 +149,3 @@ next(err)

.sort()
.forEach(function(relativePath) {
.forEach(function (relativePath) {
const filename = files[relativePath]

@@ -152,0 +152,0 @@ // root?

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