{"library":"mocha-image-compiler","title":"Mocha Image Compiler","description":"Mocha compiler that enables webpack-like importing of images (PNG, JPG, GIF, SVG) in Node.js test environments. Current version 1.0.0 is stable and rarely updated. It works by replacing image require calls with a simple path string, making it ideal for testing components that import images. Unlike webpack loaders, this is a lightweight, no-config solution specifically designed for Mocha's --compilers flag. Requires Mocha as a peer dependency.","language":"javascript","status":"active","last_verified":"Fri May 01","install":{"commands":["npm install mocha-image-compiler"],"cli":null},"imports":["require('mocha-image-compiler') (CommonJS) or import 'mocha-image-compiler' (ESM wrapper); used via --compilers flag, not directly imported in test files"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"npm install --save-dev mocha mocha-image-compiler\necho \"var logo = require('./logo.png'); console.log(logo);\" > test.js\necho '{}' > package.json\nmocha --compilers .:mocha-image-compiler test.js","lang":"javascript","description":"Installs mocha and mocha-image-compiler, creates a test file that imports a PNG image, and runs mocha with the compiler to replace image require with a path string.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}