/
githubmirror
/
hexo
Обзор
Документация
Войти
/
githubmirror
/
hexo
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
6.2.0
lib/box/file.js
35 строк
641 B
Sukka
refactor(box): remove Bluebird.asCallback (#4379)
11 июл 2020, 06:43
Не верифицирован
11 июл 2020, 06:43
17ee23f
Код
Авторство
О чём код?
'use strict'; const { readFile, readFileSync, stat, statSync } = require('hexo-fs'); class File { constructor({ source, path, params, type }) { this.source = source; this.path = path; this.params = params; this.type = type; } read(options) { return readFile(this.source, options); } readSync(options) { return readFileSync(this.source, options); } stat(options) { return stat(this.source); } statSync(options) { return statSync(this.source); } } File.TYPE_CREATE = 'create'; File.TYPE_UPDATE = 'update'; File.TYPE_SKIP = 'skip'; File.TYPE_DELETE = 'delete'; module.exports = File;