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

checkdir

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

checkdir

Check if dir exists, if it's empty and how many files are directly inside it.

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

checkdir

NPM version Build Status Dependency Status

Check if dir exists, if it's empty and how many files are directly inside it.

Install

$ npm install checkdir

Usage

var checkdir = require('checkdir');

checkdir('/some/test/dir').then(info => console.log(info));
//=> {
//    empty: false,
//    exists: true,
//    files: 1
// }

// or assuming that the only file in the dir is a 'dotfile'
checkdir('/some/test/dir', { ignoreDotFiles: true })
  .then(info => console.log(info));
//=> {
//    empty: true,
//    exists: true,
//    files: 0
// }

API

checkdir(directoryPath)

directoryPath

Required Type: String

Path to directory.

options
ignoreDotFiles

Type: Boolean (Default: false)

Don't count files/folders that begin with the dot ('.') character, e.g.. '.git' or '.gitignore'.

License

MIT © DaveJ

FAQs

Package last updated on 14 Oct 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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