mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-22 05:02:18 +08:00
17 lines
417 B
TypeScript
17 lines
417 B
TypeScript
import { exec } from 'child_process';
|
|
|
|
export const listOfPackages = (): Promise<
|
|
{ name: string; version: string; private: boolean; location: string }[]
|
|
> =>
|
|
new Promise((res, rej) => {
|
|
const command = `npx lerna list --json`;
|
|
exec(command, (e, result) => {
|
|
if (e) {
|
|
rej(e);
|
|
} else {
|
|
const data = JSON.parse(result.toString().trim());
|
|
res(data);
|
|
}
|
|
});
|
|
});
|