Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

ensureFile-sync.md 480 B

před 3 roky
1234567891011121314151617
  1. # ensureFileSync(file)
  2. Ensures that the file exists. If the file that is requested to be created is in directories that do not exist, these directories are created. If the file already exists, it is **NOT MODIFIED**.
  3. **Alias:** `createFileSync()`
  4. - `file` `<String>`
  5. ## Example:
  6. ```js
  7. const fs = require('fs-extra')
  8. const file = '/tmp/this/path/does/not/exist/file.txt'
  9. fs.ensureFileSync(file)
  10. // file has now been created, including the directory it is to be placed in
  11. ```