{"library":"node-hook","type":"library","category":null,"description":"node-hook is a low-level utility for intercepting and transforming JavaScript source code before it is loaded by Node.js's CommonJS `require` mechanism. It allows developers to register a synchronous function that receives the raw source and filename, returning a modified source string for immediate evaluation. The current stable version is 1.0.0, released in 2017. Due to its age and reliance on Node.js's CommonJS module loader, it is largely incompatible with modern ES Modules (ESM) environments. Its release cadence was infrequent, with the last update several years ago. Key differentiators include its direct manipulation of `Module._extensions['.js']` for simple, synchronous source transforms, unlike more complex bundlers or build tools, making it suitable for runtime code instrumentation or on-the-fly transpilation in legacy CommonJS applications.","language":"javascript","status":"abandoned","version":"1.0.0","tags":["javascript","require","node","load","hook","transform"],"install":[{"cmd":"npm install node-hook","imports":["const hook = require('node-hook');","const { hook } = require('node-hook');","const { unhook } = require('node-hook');"]},{"cmd":"yarn add node-hook","imports":[]},{"cmd":"pnpm add node-hook","imports":[]}],"homepage":null,"github":"https://github.com/bahmutov/node-hook","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/node-hook","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":{"summary":{"python_range":"18–22","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"url":"https://checklist.day/v1/registry/node-hook/compatibility"},"provenance":{"verified_status":null,"verified_at":null,"last_verified":"Wed Jun 17","next_check":"Sat Jul 18","install_tag":null}}