Each call to the encrypted storage goes through filename.getPath() or filename.getPathSync() functions. readdir() called with empty string, '.' or / as a path will transform it to _/ that doesn't exist.
So there is no way to read the content of the root folder. Only known subfolders may be read.
It happens at least with the aes-256-cbc algorithm.
For example, if I change default algorithm in your project from aes-256-ctr to aes-256-cbc, readdir and readdirSync tests fail because folderPath become .../crypto-fs/test/test/c8907dbcf8da255ce8ac0a297509f2a1/c8907dbcf8da255ce8ac0a297509f2a1 instead of .../crypto-fs\test\test_ as it looks with the aes-256-ctr algorithm.
Each call to the encrypted storage goes through/ that doesn't exist.
So there is no way to read the content of the root folder. Only known subfolders may be read.
It happens at least with the
filename.getPath()
orfilename.getPathSync()
functions.readdir()
called with empty string, '.' or/
as a path will transform it to _aes-256-cbc
algorithm. For example, if I change default algorithm in your project fromaes-256-ctr
toaes-256-cbc
,readdir
andreaddirSync
tests fail becausefolderPath
become .../crypto-fs/test/test/c8907dbcf8da255ce8ac0a297509f2a1/c8907dbcf8da255ce8ac0a297509f2a1 instead of .../crypto-fs\test\test_ as it looks with theaes-256-ctr
algorithm.