Spaces:
Paused
Paused
Download node_modules/fs-extra/lib/mkdirs/make-dir.js from no1b4me/hytranslator: direct link, hf CLI and curl.
- Browser
- Download file 545 Bytes
-
https://huggingface.co/spaces/no1b4me/hytranslator/resolve/main/node_modules/fs-extra/lib/mkdirs/make-dir.js
- Command line
-
hf download hf://spaces/no1b4me/hytranslator/node_modules/fs-extra/lib/mkdirs/make-dir.js
-
curl -L -o make-dir.js https://huggingface.co/spaces/no1b4me/hytranslator/resolve/main/node_modules/fs-extra/lib/mkdirs/make-dir.js
545 Bytes
| const fs = require('../fs') | |
| const { checkPath } = require('./utils') | |
| const getMode = options => { | |
| const defaults = { mode: 0o777 } | |
| if (typeof options === 'number') return options | |
| return ({ ...defaults, ...options }).mode | |
| } | |
| module.exports.makeDir = async (dir, options) => { | |
| checkPath(dir) | |
| return fs.mkdir(dir, { | |
| mode: getMode(options), | |
| recursive: true | |
| }) | |
| } | |
| module.exports.makeDirSync = (dir, options) => { | |
| checkPath(dir) | |
| return fs.mkdirSync(dir, { | |
| mode: getMode(options), | |
| recursive: true | |
| }) | |
| } | |