async rmDir(path, options = { recursive: false }) {
    path = normalizePath(path)
    const docId = DOCUMENT_ID_PREFIX + path
    const doc = await this.db.get(docId, { attachments: false })
      .catch(err => {
        if (err.name !== 'not_found') {
          throw unknowError(err)
        }
        return false
      })
    if (!doc) {
      return false
    }
    if (!doc.isDirectory) {
      return false
    }

    // Check if it have childrens and implement the logic of options.recursive
    const childrens = await this.listAllFilesOnAPath(path, { onlyPaths: true })
    if (childrens.length > 0 && !options.recursive) {
      return false
    } else if (options.recursive) {
      await Promise.all(childrens.map(children => { this.rmDir(children, options) }))
    }

    return this.db.remove(doc._id, doc._rev)
      .catch(err => {
        throw unknowError(err)
      })
      .then(result => {
        return result.ok
      })
  }
/**
   * Deletes a directory
   * @param {string} path - Path of the directory
   * @param {object} [options] - Options
   * @param {object} [options.recursive] - Delete all content of the directory on a recursive way
   * @returns {boolean} True if deletes sucesfully one or more directories or files. False if not deleted anything
   */
Deletes a directory
@param {string} path - Path of the directory
@param {object} [options] - Options
@param {object} [options.recursive] - Delete all content of the directory on a recursive way
@returns {boolean} True if deletes sucesfully one or more directories or files. False if not deleted anything
Deletes a directory @param { string } path - Path of the directory @param { object } [ options ] - Options @param { object } [ options . recursive ] - Delete all content of the directory on a recursive way @returns { boolean } True if deletes sucesfully one or more directories or files . False if not deleted anything
async rmDir(path, options = { recursive: false }) {
    path = normalizePath(path)
    const docId = DOCUMENT_ID_PREFIX + path
    const doc = await this.db.get(docId, { attachments: false })
      .catch(err => {
        if (err.name !== 'not_found') {
          throw unknowError(err)
        }
        return false
      })
    if (!doc) {
      return false
    }
    if (!doc.isDirectory) {
      return false
    }
    const childrens = await this.listAllFilesOnAPath(path, { onlyPaths: true })
    if (childrens.length > 0 && !options.recursive) {
      return false
    } else if (options.recursive) {
      await Promise.all(childrens.map(children => { this.rmDir(children, options) }))
    }
    return this.db.remove(doc._id, doc._rev)
      .catch(err => {
        throw unknowError(err)
      })
      .then(result => {
        return result.ok
      })
  }
async rmDir ( path , options = { recursive : false } ) { path = normalizePath ( path ) const docId = DOCUMENT_ID_PREFIX + path const doc = await this . db . get ( docId , { attachments : false } ) . catch ( err => { if ( err . name !== 'not_found' ) { throw unknowError ( err ) } return false } ) if ( ! doc ) { return false } if ( ! doc . isDirectory ) { return false } const childrens = await this . listAllFilesOnAPath ( path , { onlyPaths : true } ) if ( childrens . length > 0 && ! options . recursive ) { return false } else if ( options . recursive ) { await Promise . all ( childrens . map ( children => { this . rmDir ( children , options ) } ) ) } return this . db . remove ( doc . _id , doc . _rev ) . catch ( err => { throw unknowError ( err ) } ) . then ( result => { return result . ok } ) }
Deletes a directory
 @param {string} path - Path of the directory
 @param {object} [options] - Options
 @param {object} [options.recursive] - Delete all content of the directory on a recursive way
 @returns {boolean} True if deletes sucesfully one or more directories or files.
Deletes a directory @param { string } path - Path of the directory @param { object } [ options ] - Options @param { object } [ options . recursive ] - Delete all content of the directory on a recursive way @returns { boolean } True if deletes sucesfully one or more directories or files .
// Check if it have childrens and implement the logic of options.recursive