Socket
Socket
Sign inDemoInstall

@storybook/instrumenter

Package Overview
Dependencies
Maintainers
29
Versions
955
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@storybook/instrumenter

The Storybook Instrumenter is used to patch a (3rd party) module to track and intercept function invocations for step-through debugging using the Interactions addon.


Version published
Weekly downloads
3.2M
decreased by-0.21%
Maintainers
29
Weekly downloads
 
Created

What is @storybook/instrumenter?

The @storybook/instrumenter package is part of the Storybook ecosystem, designed to help developers instrument their code for interaction testing and debugging within the Storybook UI. It provides utilities to track and manipulate function calls, enabling more interactive and dynamic story creation.

What are @storybook/instrumenter's main functionalities?

Code Instrumentation

This feature allows developers to wrap their functions with instrumentation logic, which enables tracking and controlling the execution of these functions within Storybook's UI. The code sample shows how to instrument a simple function to log its execution.

import { instrument } from '@storybook/instrumenter';

const originalFunction = () => { console.log('Original function execution'); };
const instrumentedFunction = instrument(originalFunction, 'uniqueKey');
instrumentedFunction();

Interaction Tracking

Enables the tracking of function calls, which can be viewed and manipulated in Storybook's interaction panel. This is useful for debugging and understanding component behaviors during development.

import { track } from '@storybook/instrumenter';

const trackedFunction = track(() => { console.log('Function called'); }, 'trackedFunction');
trackedFunction();

Other packages similar to @storybook/instrumenter

Keywords

FAQs

Package last updated on 30 Nov 2021

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc