# Code coverage report for mz/fs.js

## Statements: 100% (6 / 6) Branches: 100% (0 / 0) Functions: 100% (2 / 2) Lines: 100% (6 / 6) Ignored: none

All files » mz/ » fs.js

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    1

    1

    1

    1
    1
    1

    var fs = require('fs')

    require('./_promisify_all.js')(fs, exports, [
      'rename',
      'ftruncate',
      'chown',
      'fchown',
      'lchown',
      'chmod',
      'fchmod',
      'stat',
      'lstat',
      'fstat',
      'link',
      'symlink',
      'readlink',
      'realpath',
      'unlink',
      'rmdir',
      'mkdir',
      'readdir',
      'close',
      'open',
      'utimes',
      'futimes',
      'fsync',
      'write',
      'read',
      'readFile',
      'writeFile',
      'appendFile',
    ])

    var promisify = require('./_promisify.js')

    // don't know enough about promises to do this haha
    exports.exists = promisify('exists', function exists(filename, done) {
      fs.stat(filename, function (err) {
        done(null, !err)
      })
    })