mkdirSync
Start from API_LEVEL
2.0
. Please refer to API_LEVEL.
Synchronously create a directory in the /data
directory of the Mini Program.
Type
function mkdirSync(option: Option): Result
Simplified calling method
function mkdirSync(path: string): Result
Parameters
Option
Property | Type | Required | DefaultValue | Description | API_LEVEL |
---|---|---|---|---|---|
path | string | Y | - | Directory path | 2.0 |
Result
Type | Description |
---|---|
number | If 0 is returned, success is indicated |
Example
import { mkdirSync } from '@zos/fs'
const result = mkdirSync({
path: 'content',
})
if (result === 0) {
console.log('mkdirSync success')
}