Helpers to get information about single/multi-package contexts
npm install @wixc3/resolve-directory-context

Helpers to get information about single/multi-package contexts.
Supports:
- single packages
- "workspaces" in package.json (yarn or npm@7)
- lerna.json defined workspaces
- resolveDirectoryContext
``ts
import fs from 'fs';
import path from 'path';
import { resolveDirectoryContext } from '@wixc3/resolve-directory-context';
const context = resolveDirectoryContext(basePath, { ...fs, ...path });
if (context.type === 'multi') {
// context.rootPackage === {...}
// context.packages === [{...}, {...}]
} else {
// context.type === 'single'
// context.npmPackage === {...}
}
``
MIT