šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Sign inDemoInstall
Socket

@wixc3/resolve-directory-context

Package Overview
Dependencies
Maintainers
70
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wixc3/resolve-directory-context

Helpers to get information about single/multi-package contexts

5.0.1
latest
Source
npm
Version published
Weekly downloads
9.6K
-26.63%
Maintainers
70
Weekly downloads
Ā 
Created
Source

@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

Keywords

packages

FAQs

Package last updated on 29 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts