readdirSync
Start from API_LEVEL
2.0
. Please refer to API_LEVEL.
Read the directory under the /data
directory of the Mini Program synchronously.
Type
function readdirSync(option: Option): Result
Parameters
Option
Property | Type | Required | DefaultValue | Description | API_LEVEL |
---|---|---|---|---|---|
path | string | Y | - | Directory path | 2.0 |
Result
Type | Description |
---|---|
Array<string>|undefined | If undefined is returned, the directory does not exist, otherwise an array of filenames is returned |
Example
import { readdirSync } from '@zos/fs'
const result = readdirSync({
path: 'content',
})