packageJsonSync

Type:Function
Status:beta
Since:1.0.0
Platform:node
@blackbyte.sugar.node.package

This function simply take a package name (or ”.” for the current package) as parameter, and return the corresponding package.json JSON content

Params

  1. nameOrPath”process.cwd()“String

    The package name or path wanted

  2. settings{}TComposerVendorDirSettings

    Some settings to configure your process

Return

  1. -JSON

    The package.json content

Example

import { packageJsonSync } from '@blackbyte/sugar/package`;
packageJsonSync('blackbyte/sugar');

Settings

  1. cwdprocess.cwd()String

    The directory in which you want to start the research

  2. monorepofalseBoolean

    Specify if you are in a monorepo context

  3. checkExistencetrueBoolean

    Specify if you want to check if the vendor dir exists

Todo

  • Implement a cache strategy to avoid making same process again and againnormal