Socket
Book a DemoInstallSign in
Socket

@gitlab/noop

Package Overview
Dependencies
Maintainers
7
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gitlab/noop

This is a noop dependency to be able to prune parts of a dependency graph.

latest
Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
47K
337.22%
Maintainers
7
Weekly downloads
 
Created
Source

@gitlab/noop

The idea behind this package is to be able to prune subtrees of dependencies which you might not need.

Reasons for why you might want to do this:

  • Some dependencies (e.g. treesitter) ship a node/server and a browser component. You might not be interested in the server component, so you could prune the node/server subtree of dependencies.
  • A particular part of dependencies might not be problematic and leading to oddities. One particular example is the glob package which ships a CLI interface which has some ESM-dependencies. One can reduce the dependency graph by quite a bit

Usage

The different package managers have different resolution features.

npm@v10

overrides is the native npm feature to override the version of a package. You can target sub-dependencies:

Example:

{
  "overrides": {
    "glob": {
      "jackspeak": "npm:@gitlab/noop@1.0.0"
    }
  }
}

yarn@v1

Use Selective dependency resolutions and add a resolutions field to the package.json. The resoltions field allows pretty accurate sub-selection of dependencies.

Example:

{
  "resolutions": {
    "glob/jackspeak": "npm:@gitlab/noop@1.0.0"
  }
}

yarn@v4

You can set the resolution manually with e.g.

yarn set resolution 'jackspeak@npm:^2.3.5' 'npm:@gitlab/noop@1.0.0'

which will only update yarn.lock. Alternatively, you can update the package.json as well, which is a little more verbose:

Example:

{
  "resolutions": {
    "jackspeak@npm:^2.3.5": "npm:@gitlab/noop@1.0.0"
  }
}

pnpm@v9

pnpm.overrides is the canonical way to define a resolution for pnpm:

NOTE: With pnpm@9.12.0, you don't need this package. You can simply use - as an override!

For older versions you can use this example:

{
  "pnpm": {
    "overrides": {
      "glob>jackspeak": "npm:@gitlab/noop@1.0.0"
    }
  }
}

bun@v1

Bun supports both npm style overrides and yarn@1 style resolutions.

Example:

{
  "resolutions": {
    "jackspeak": "npm:@gitlab/noop@1.0.0"
  }
}

FAQs

Package last updated on 15 Jan 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