@wixc3/resolve-directory-context
TypeScript icon, indicating that this package has built-in type declarations

4.0.0 • Public • Published

@wixc3/resolve-directory-context

Build Status npm version

Helpers to get information about single/multi-package contexts.

Features

Supports:

  • single packages
  • "workspaces" in package.json (yarn or npm@7)
  • lerna.json defined workspaces

API

  • resolveDirectoryContext
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 === {...}
}

License

MIT

Package Sidebar

Install

npm i @wixc3/resolve-directory-context

Weekly Downloads

2,185

Version

4.0.0

License

MIT

Unpacked Size

45.9 kB

Total Files

33

Last publish

Collaborators

  • dorza
  • vladba-wix
  • danielgovrin
  • yurimorkovnik
  • ranberko91
  • 0xrezaa
  • gregdamsky
  • alissawix
  • ekaterinaza
  • noammu
  • buchenpilar
  • oleksiiletushev
  • alisalachman
  • vladyslav-baliuk
  • yuriin
  • ilyakwix
  • matang
  • daomry
  • noama
  • shakederin
  • dlvhdr
  • plisovyi
  • pijusn
  • shireewill
  • haryelp
  • iuriikowix
  • itaywix
  • thealmightycrumb
  • devex-infra
  • olehr
  • tomrav
  • avi.vahl
  • alexswix
  • omerk
  • talga
  • cijoe
  • wix-ci
  • wixnpm
  • baraki
  • interal
  • alisey
  • danieleww
  • idoros
  • nadavwix
  • rashellek
  • wtfil
  • denysdovhan
  • vkobeliatskyi
  • pistolpete_
  • nettaru
  • igalh
  • netanelgilad
  • anatfenn
  • erezshasha
  • zemlanin
  • arnonkehat
  • ariki
  • itpurchases
  • danalevy
  • serhiiz
  • oleksandraab
  • idango10
  • mikanadel
  • tetiana0611
  • vladkar
  • yurii-v
  • elig-wix
  • nadav.a
  • vladyslavgoloshchapov