/
Mikhail823
/
todo
Обзор
Документация
Войти
/
Mikhail823
/
todo
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
node_modules/read-pkg-up/index.js
30 строк
581 B
Mikhail Popov
j
23 фев 2026, 16:12
23 фев 2026, 16:12
ff7232a
Код
Авторство
О чём код?
'use strict'; const path = require('path'); const findUp = require('find-up'); const readPkg = require('read-pkg'); module.exports = async options => { const filePath = await findUp('package.json', options); if (!filePath) { return; } return { packageJson: await readPkg({...options, cwd: path.dirname(filePath)}), path: filePath }; }; module.exports.sync = options => { const filePath = findUp.sync('package.json', options); if (!filePath) { return; } return { packageJson: readPkg.sync({...options, cwd: path.dirname(filePath)}), path: filePath }; };