{"id":14731,"library":"node-bitmap","title":"Bitmap Image Library for Node.js","description":"node-bitmap is a pure JavaScript library designed for low-level bitmap image manipulation within Node.js environments. Published over a decade ago as version 0.0.1, this package offers basic functionalities for creating and modifying uncompressed bitmap data, including setting and getting individual pixel values. It was developed to run on very old Node.js versions (>=v0.6.5) and has seen no updates or maintenance since its initial release. Consequently, it is considered abandoned and lacks compatibility with modern JavaScript features, Node.js versions, and security patches. Its primary differentiator was its 'pure JavaScript' implementation, avoiding native dependencies at a time when such libraries often required them, but this also means it is likely slower and less feature-rich than contemporary alternatives.","status":"abandoned","version":"0.0.1","language":"javascript","source_language":"en","source_url":"git://github.com/nowelium/node-bitmap","tags":["javascript"],"install":[{"cmd":"npm install node-bitmap","lang":"bash","label":"npm"},{"cmd":"yarn add node-bitmap","lang":"bash","label":"yarn"},{"cmd":"pnpm add node-bitmap","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package exclusively uses CommonJS `require()` syntax as it predates Node.js ESM support. Attempting to use `import` will result in a runtime error.","wrong":"import Bitmap from 'node-bitmap';","symbol":"Bitmap","correct":"const Bitmap = require('node-bitmap');"},{"note":"The primary export is a constructor function (class in modern terms) named `Bitmap`. Instances are created using the `new` keyword.","wrong":"const bmp = require('node-bitmap')(width, height);","symbol":"BitmapInstance","correct":"const bmp = new Bitmap(width, height);"}],"quickstart":{"code":"const Bitmap = require('node-bitmap');\n\n// Create a new 100x50 pixel bitmap with a default background (often black)\nconst width = 100;\nconst height = 50;\nconst bmp = new Bitmap(width, height);\n\n// Set a pixel at (10, 20) to red (RGBA)\nbmp.setPixel(10, 20, 255, 0, 0, 255);\n\n// Get the pixel data at (10, 20)\nconst pixel = bmp.getPixel(10, 20);\nconsole.log(`Pixel at (10, 20): R=${pixel.r}, G=${pixel.g}, B=${pixel.b}, A=${pixel.a}`);\n\n// Fill a small square with blue\nfor (let y = 5; y < 15; y++) {\n  for (let x = 5; x < 15; x++) {\n    bmp.setPixel(x, y, 0, 0, 255, 255);\n  }\n}\n\n// In a real application, you would then convert this bitmap to a buffer\n// for saving to a file or sending over a network, e.g., bmp.toBuffer();\n// (Note: The `toBuffer` method might not be directly available or might need\n// specific arguments; this quickstart focuses on pixel manipulation.)\nconsole.log(`Created a ${width}x${height} bitmap and manipulated pixels.`);\n// Example of accessing raw buffer (highly dependent on implementation)\n// console.log('Bitmap raw buffer size:', bmp.buffer.length);\n","lang":"javascript","description":"Demonstrates how to initialize a new bitmap, set individual pixel colors, and retrieve pixel data using the CommonJS `require` syntax."},"warnings":[{"fix":"Migrate to a maintained image processing library like 'sharp', 'jimp', or 'canvas'.","message":"This package is severely outdated (v0.0.1, published over 12 years ago) and is not compatible with modern Node.js versions (e.g., >=12, >=14). It requires Node.js v0.6.5 or older.","severity":"breaking","affected_versions":">=0.0.1"},{"fix":"Always use `npm install node-bitmap` to install this package, although installation is not recommended due to its abandoned status.","message":"The README contains a significant typo for installation, instructing `npm install socket.io-store-memcached` instead of `npm install node-bitmap`.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"If you must use this package (not recommended), ensure your project is configured for CommonJS or use dynamic `await import()` (if supported by your Node.js version and context).","message":"The package uses CommonJS `require()` exclusively and does not support ES Modules (`import`). Attempting to `import` it will result in a runtime error.","severity":"breaking","affected_versions":">=0.0.1"},{"fix":"Do not use this package in production. If forced to use for legacy reasons, isolate it strictly and consider manual security reviews.","message":"As an abandoned package, `node-bitmap` has not received any security updates in over a decade. It may contain known or unknown vulnerabilities, making it unsafe for production use, especially in applications handling untrusted input.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Thoroughly review the source code for available methods. Expect to implement conversion and saving logic manually or use it only for in-memory pixel manipulation.","message":"The API is likely unstable, incomplete, and undocumented. Given its 0.0.1 version, core functionalities like saving to common image formats might be missing or poorly implemented.","severity":"breaking","affected_versions":">=0.0.1"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Ensure the package is installed with `npm install node-bitmap` and use `const Bitmap = require('node-bitmap');` for importing.","cause":"Attempting to use `import` syntax in an ES Module context or running in an environment where CommonJS `require` is not available, or the package simply isn't installed.","error":"Error: Cannot find module 'node-bitmap'"},{"fix":"Either convert your project or file to CommonJS (`.js` without `\"type\": \"module\"` or `.cjs` file extension) or use dynamic import with `const Bitmap = (await import('node-bitmap')).default;` if the package's exports allow it (unlikely for this specific package).","cause":"This error occurs when trying to use `require` in a pure ES Module (ESM) environment (e.g., `\"type\": \"module\"` in package.json, or a `.mjs` file) where `require` is not globally available.","error":"TypeError: require is not a function"},{"fix":"This package is incompatible with modern Node.js. If you absolutely must run it, you would need to use a Node.js version less than v1.0, which is highly discouraged. The real fix is to use a modern library.","cause":"Modern Node.js versions do not satisfy the `engines` requirement of this ancient package, leading to peer dependency warnings or errors during installation or runtime incompatibility.","error":"node-bitmap@0.0.1 requires a peer of node@>=v0.6.5 but none was installed."}],"ecosystem":"npm"}