Registry / testing / immutable-devtools

immutable-devtools

JSON →
library0.1.5jsnpmunverified

Chrome DevTools custom formatter for Immutable.js collections (List, Map, Set, Stack, Record). Version 0.1.5, no recent releases since 2016. Transforms opaque internal structures into readable listings in the Console and Scope panel. Must be explicitly installed in browser environments; works only with Chrome v47+ and requires enabling custom formatters in DevTools settings. Intended for development-only use. Provides a Chrome extension alternative. Covers common immutable types but not Seq, Range, or Repeat.

npm install immutable-devtools
INSTALL
IMPORT
SIG · IMMUTABLE-DEVTOOLS
I
immutable-devtools
testingjavascriptv0.1.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

installDevTools
import installDevTools from 'immutable-devtools'
const { installDevTools } = require('immutable-devtools')
The module exports a single function via default export. Named destructuring will result in undefined.
default import (installDevTools)
const installDevTools = require('immutable-devtools')
const { default: installDevTools } = require('immutable-devtools')
For CJS, use default require. The package has no named exports.
TypeScript usage
// @ts-ignore import installDevTools from 'immutable-devtools'
import { installDevTools } from 'immutable-devtools'
Package has no type definitions; use dynamic require or @ts-ignore to avoid TS errors.

Installs DevTools formatter for Immutable.js collections, showing how to conditionally require only in development and how to enable formatters in Chrome.

// Install: npm install --save-dev immutable-devtools import Immutable from 'immutable'; import installDevTools from 'immutable-devtools'; // Only in development if (process.env.NODE_ENV !== 'production') { installDevTools(Immutable); console.log('Immutable DevTools installed. Enable custom formatters in Chrome DevTools settings.'); } // Now when you log an Immutable collection: const list = Immutable.List([1, 2, 3]); console.log(list); // Chrome DevTools will show [1, 2, 3] instead of the internal structure
Debug
Known issues
gotchaMust enable custom formatters in Chrome DevTools manually: DevTools Settings > Console > Enable custom formatters.
fix
Open DevTools, press F1, scroll to Console section, check 'Enable custom formatters'.
affects: >=0.0.0
gotchaThe package is a development-only tool; installing in production may cause issues or bundle size increase.
fix
Wrap require/import in environment check: if (process.env.NODE_ENV !== 'production') { ... } or use webpack DefinePlugin.
affects: >=0.0.0
deprecatedNo updates since 2016; may not work with newer Immutable.js versions or Chrome changes.
fix
Consider using Chrome extension 'Immutable.js Object Formatter' by mattzeunert for automatic updates.
affects: >=0.1.5
gotchaCommonJS require using destructuring: 'const { installDevTools } = require(...)' yields undefined.
fix
Use default require: 'const installDevTools = require(...)'
affects: >=0.0.0
gotchaESM import with named import: 'import { installDevTools } from ...' fails because package only has default export.
fix
Use default import: 'import installDevTools from ...'
affects: >=0.0.0
Errors
Common errors & fixes
Uncaught TypeError: installDevTools is not a function
Using named destructuring require 'const { installDevTools } = require(...)' instead of default require.
fix
Replace with 'const installDevTools = require('immutable-devtools')'
Uncaught TypeError: installDevTools is not a function
Using named ES6 import 'import { installDevTools } from ...'
fix
Replace with 'import installDevTools from 'immutable-devtools''
ImmutableDevTools: Must be called with Immutable.js instance
Called installDevTools() without passing the Immutable module.
fix
Ensure you pass the Immutable object: installDevTools(Immutable)
Upgrade
Version history
0.1.5latest on npm
Audit
Dependencies
immutablerequiredThe library requires an Immutable.js instance to install formatters; must be called with installDevTools(Immutable).
Agent activity
6 hits · last 30 days
node
6
Resources
immutable-devtools — npm install immutable-devtools · libregistry