🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

@dazl/resolve-directory-context

Package Overview
Dependencies
Maintainers
33
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dazl/resolve-directory-context

Helpers to get information about single/multi-package contexts

latest
Source
npmnpm
Version
5.1.0
Version published
Maintainers
33
Created
Source

@dazl/resolve-directory-context

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 '@dazl/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 14 Sep 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