New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@envelop/instruments

Package Overview
Dependencies
Maintainers
0
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@envelop/instruments

This package contains uitility functions and types to ease the use of instruments accross Envelop, Yoga, wathwg-node and Hive Gateway plugins.

  • 1.0.0-alpha-20250227114734-64d7083775b6c1ee4ce365437ae5f77c33aee3a5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.3K
Maintainers
0
Weekly downloads
 
Created
Source

@envelop/instruments

This package contains uitility functions and types to ease the use of instruments accross Envelop, Yoga, wathwg-node and Hive Gateway plugins.

getInstrumentsAndPlugins(plugins: Plugin[]): { pluginInstruments: Instruments[], plugins: Plugin[] }

This function extracts the instruments from the plugins and returns both the extracted instruments and the plugins without their instruments field.

This is usefull when you want to customize the execution order of the instruments.

import { getInstrumentsAndPlugins } from '@envelop/instruments'

const { pluginInstruments, plugins } = getInstrumentsAndPlugins([
  // put you plugin list here. This list can contain plugins with and without instruments.
])

composeInstruments(instruments: Instruments[]): Instruments

This function composes all the instruments into one. The instruments will be called in the same order than they are in the array (first is outter most call, last is inner most).

This can be used in conjonction with getInstrumentsAndPlugins function to customize the order of execution of the instruments if the default one doesn't suites your needs.

import { getInstrumentsAndPlugins } from '@envelop/instruments'

const { pluginInstruments, plugins } = getInstrumentsAndPlugins([
  // put you plugin list here. This list can contain plugins with and without instruments.
])

const instruments = composeInstruments(pluginInstruments)

const getEnveloped = envelop({
  plugins: [...plugins, { instruments }]
})

FAQs

Package last updated on 27 Feb 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc