/
githubmr
/
facebook-react-native
Обзор
Документация
Войти
/
githubmr
/
facebook-react-native
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
v0.80.2
.github/workflow-scripts/utils.js
33 строки
704 B
Riccardo Cipolleschi
Fix release scripts to check npm packages (#49788)
03 мар 2025, 17:54
03 мар 2025, 17:54
70c3b2d
Код
Авторство
О чём код?
/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @format */ const {execSync} = require('child_process'); const log = (...args) => console.log(...args); async function getNpmPackageInfo(pkg, versionOrTag) { return fetch(`https://registry.npmjs.org/${pkg}/${versionOrTag}`).then(resp => resp.json(), ); } async function sleep(seconds) { return new Promise(resolve => setTimeout(resolve, seconds * 1000)); } function run(cmd) { return execSync(cmd, 'utf8').toString().trim(); } module.exports = { log, getNpmPackageInfo, sleep, run, };