Fs-Extra 可以只删除目录下的文件吗?
Can Fs-Extra delete only files in a directory?
我可以在不删除目录本身的情况下删除 apples 目录中的所有文件吗? fs-extra API不描述是否可以
fsExtra.remove 'apples/*', ->
if !err
# Do stuff
您可以使用emptyDir
Ensures that a directory is empty. If the directory does not exist, it is created. The directory itself is not deleted.
fsExtra.emptyDir 'apples/', ->
if !err
# Do stuff
我可以在不删除目录本身的情况下删除 apples 目录中的所有文件吗? fs-extra API不描述是否可以
fsExtra.remove 'apples/*', ->
if !err
# Do stuff
您可以使用emptyDir
Ensures that a directory is empty. If the directory does not exist, it is created. The directory itself is not deleted.
fsExtra.emptyDir 'apples/', ->
if !err
# Do stuff