mirror of
https://github.com/semantic-release/semantic-release.git
synced 2026-10-27 00:17:01 +00:00
63323861a3
BREAKING CHANGE: the npm cli is upgraded to v12. find details about breaking changes at https://github.com/npm/cli/releases/tag/v12.0.0
9 lines
271 B
JavaScript
9 lines
271 B
JavaScript
import { execa } from "execa";
|
|
|
|
export async function npmView(packageName, env) {
|
|
const view = JSON.parse((await execa("npm", ["view", packageName, "--json"], { env })).stdout);
|
|
|
|
// npm 12 wraps the result in an array
|
|
return Array.isArray(view) ? view[0] : view;
|
|
}
|