{"library":"ninja-build","title":"Ninja Build System Wrapper","description":"The `ninja-build` npm package serves as a lightweight Node.js wrapper for the Ninja build system. Its primary function is to simplify the inclusion and execution of the Ninja binary (version 1.3.4) within Node.js projects, abstracting away the manual download and compilation steps. Currently at version 0.1.5, this package is largely unmaintained, with its last update occurring many years ago. It bundles an extremely old version of Ninja (1.3.4, whereas modern Ninja is significantly higher). While initially designed for ease of use within Node.js workflows, its lack of updates, especially regarding the bundled Ninja version and explicit lack of Windows support, severely limits its utility in modern development environments. The package has no active release cadence.","language":"javascript","status":"abandoned","last_verified":"Sun Apr 19","install":{"commands":["npm install ninja-build"],"cli":{"name":"ninja","version":null}},"imports":["const ninjaPath = require.resolve('ninja-build/bin/ninja');","./node_modules/ninja-build/bin/ninja --version","// No direct JavaScript import is possible as this package provides a binary."],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"const { spawn } = require('child_process');\nconst path = require('path');\n\n// Determine the path to the Ninja binary provided by the package\n// This ensures the correct binary is found relative to node_modules\nconst ninjaBinaryPath = require.resolve('ninja-build/bin/ninja');\n\nconsole.log(`Attempting to execute Ninja from: ${ninjaBinaryPath}`);\n\n// Spawn a child process to execute the Ninja binary\n// Here, we run `ninja -h` to display help information\nconst ninjaProcess = spawn(ninjaBinaryPath, ['-h']);\n\nninjaProcess.stdout.on('data', (data) => {\n  console.log(`Ninja stdout:\\n${data}`);\n});\n\nninjaProcess.stderr.on('data', (data) => {\n  console.error(`Ninja stderr:\\n${data}`);\n});\n\nninjaProcess.on('close', (code) => {\n  console.log(`Ninja process exited with code ${code}`);\n  if (code !== 0) {\n    console.error('Ninja execution failed. Check stderr for details.');\n  }\n});\n","lang":"javascript","description":"This quickstart demonstrates how to programmatically find and execute the bundled Ninja binary within a Node.js script using `child_process`, printing its help output.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}