New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

check-dir

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

check-dir

check the dir

latest
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

check-dir

检查指定目录是否为空,对外暴露两个方法:

checkDir(异步)

exports.checkDir = function (path, callback) {

    fs.readdir(path, function (err, files) {

        if (err === null) {
            callback(null, files)
        } else {
            callback(err);
        }
    });
};

checkDirSync(同步)

exports.checkDirSync = function (path) {

    var files = fs.readdirSync(path);

    if (files.length > 0) {

        return true;

    } else {

        return false;

    }
};

FAQs

Package last updated on 03 Nov 2015

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