Skip to content

existsSync is deprecated; maybe use statSync in a try catch instead #201

@jskrzypek

Description

@jskrzypek

Instead of

fs.existsSync('some/file');

this probably ought to be a wrapper around fs.statSync

fileExistsSync('some/file');
// ...
function fileExistsSync(path) {
    try {
        fs.statSync('some/file');
        return true;
    } catch (e) {
        return false;
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions