Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@pnpm/better-defaults

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pnpm/better-defaults

Improved defaults for pnpm

latest
Source
npmnpm
Version
0.2.2
Version published
Maintainers
2
Created
Source

@pnpm/better-defaults

Improved defaults for pnpm

What it changes

  • Sets enableGlobalVirtualStore to true.
  • Sets enablePrePostScripts to false.
  • Sets hoistPattern to an empty array, disabling hoisting.
  • Sets ignorePatchFailures to false.
  • Sets optimisticRepeatInstall to true.
  • Sets resolutionMode to lowest-direct.
  • Sets verifyDepsBeforeRun to install.

You can extend or override these settings in your own .pnpmfile.cjs.

Installation

pnpm add --config @pnpm/better-defaults

This will add @pnpm/better-defaults to the configDependencies field in your pnpm-workspace.yaml.

Usage

If you don't have a pnpmfile in your project, then add this to pnpm-workspace.yaml:

pnpmfile: node_modules/.pnpm-config/@pnpm/better-defaults/pnpmfile.cjs

If you have a .pnpmfile.cjs already in your project, then you can reexport the updateConfig hooks from @pnpm/better-defaults. This should be your .pnpmfile.cjs:

module.exports = {
  hooks: {
    ...require('.pnpm-config/@pnpm/better-defaults/pnpmfile.cjs').hooks,
    // Other hooks in your project
  }
}

Alternatively, you may have other changes in your updateConfig hook:

const { updateConfig: makeBetterDefaults } = require('.pnpm-config/@pnpm/better-defaults/pnpmfile.cjs').hooks

module.exports = {
  hooks: {
    updateConfig (config) {
      return {
        ...makeBetterDefaults(config),
        hoistPattern: ['*'],
      }
    }
  }
}

License

MIT

Keywords

pnpm-config

FAQs

Package last updated on 08 Jun 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