storybook/scripts/utils/list-packages.js

15 lines
331 B
JavaScript
Raw Normal View History

2020-05-09 11:34:50 +02:00
import { exec } from 'child_process';
export const listOfPackages = () =>
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);
}
});
});