How to use the mkdirp.mkdirp.sync function in mkdirp

To help you get started, we’ve selected a few mkdirp examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github FreeFeed / freefeed-server / test / integration / models / attachment.js View on Github external
before(async () => {
      // Create user
      user = new User({
        username: 'Luna',
        password: 'password'
      })
      await user.create()

      // Create directories for attachments
      mkdirp.sync(config.attachments.storage.rootDir + config.attachments.path)

      await Promise.all(_.map(
        config.attachments.imageSizes,
        (size) => mkdirpAsync(config.attachments.storage.rootDir + size.path)
      ));

      // "Upload" files
      const filesToUpload = {
        'test-image.150x150.png':              '1',
        'test-image.900x300.png':              '2',
        'test-image.1500x1000.png':            '3',
        'test-image.3000x2000.png':            '4',
        'test-image-exif-rotated.900x300.jpg': '5',
        'test-image-sgrb.png':                 '6',
        'test-image-animated.gif':             '7',
        'sample.mp3':                          '8',