{"library":"module-available","title":"Module Availability Checker","description":"The `module-available` package provides a synchronous utility function to determine if a given Node.js module name can be successfully resolved and loaded using the `require` mechanism. The current stable version is 1.0.6, released in early 2016. The project appears to be unmaintained, with no updates in over eight years, making it an `abandoned` project. Its core function remains stable for its intended use case: checking the existence and resolvability of modules typically found in `node_modules` or built-in Node.js modules, without actually loading them. This differentiates it from simply attempting a `try/catch` around `require`, as it specifically checks *availability* rather than *loading success*. It strictly operates within the CommonJS module resolution context.","language":"javascript","status":"abandoned","last_verified":"Sun Apr 19","install":{"commands":["npm install module-available"],"cli":null},"imports":["const moduleAvailable = require('module-available');"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"const moduleAvailable = require('module-available');\n\nconsole.log(\"Checking module availability...\");\n\n// Check for a built-in Node.js module\nconsole.log(`'fs' module available: ${moduleAvailable('fs')}`); // Should be true\n\n// Check for an installed npm package (e.g., 'express')\n// You might need to `npm install express` for this to be true\nconsole.log(`'express' module available: ${moduleAvailable('express')}`);\n\n// Check for another installed npm package (e.g., 'lodash')\n// You might need to `npm install lodash` for this to be true\nconsole.log(`'lodash' module available: ${moduleAvailable('lodash')}`);\n\n// Check for a module that is definitely not installed\nconsole.log(`'non-existent-module-abc' available: ${moduleAvailable('non-existent-module-abc')}`); // Should be false\n\n// Note: This only checks for modules resolvable by 'require' and does not support ESM imports.\n// It also does not check for relative file paths.","lang":"javascript","description":"This quickstart demonstrates how to use `module-available` to check for the presence of built-in Node.js modules and installed npm packages, both existing and non-existent, using CommonJS `require` syntax.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}