Registry / devops / buildcheck

buildcheck

JSON →
library0.0.7jsnpmunverified

buildcheck is a Node.js utility library designed to perform autoconf-like environment checks for native addons and build scripts. It allows developers to programmatically determine the capabilities of the host system's C/C++ build environment, such as the existence of specific functions, headers, or the ability to compile arbitrary code snippets. Currently at version 0.0.7, its release cadence appears slow or inactive, and it primarily supports Node.js versions 10.0.0 and newer. Key differentiators include its direct integration within the Node.js ecosystem, providing a JavaScript API to probe compiler features (GCC, Clang, MSVC 2013+) and abstracting away the underlying compilation commands, making cross-platform build configuration more manageable for Node.js projects that rely on native components.

npm install buildcheck
INSTALL
IMPORT
SIG · BUILDCHECK
B
buildcheck
devopsjavascriptv0.0.7
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

BuildEnvironment
const BuildEnvironment = require('buildcheck');
import { BuildEnvironment } from 'buildcheck';
The package is CommonJS-only based on provided examples. Direct ESM import might not work without a CommonJS wrapper or transpilation, especially for Node.js versions that require explicit module types.

This example demonstrates how to create a BuildEnvironment instance and use it to check for the existence of a C function, the usability of a C header, and the ability to compile both valid and intentionally invalid C code snippets.

'use strict'; const BuildEnvironment = require('buildcheck'); async function runChecks() { const buildEnv = new BuildEnvironment(); console.log('--- Checking C function preadv2 ---'); const preadv2Exists = buildEnv.checkFunction('c', 'preadv2'); console.log(`preadv2 exists: ${preadv2Exists}`); console.log('--- Checking C header linux/io_uring.h ---'); const ioUringHeaderUsable = buildEnv.checkHeader('c', 'linux/io_uring.h'); console.log(`linux/io_uring.h usable: ${ioUringHeaderUsable}`); console.log('--- Trying to compile simple C code ---'); const successfulCompile = buildEnv.tryCompile('c', 'int main() { return 0; }'); console.log(`Successful compile: ${successfulCompile}`); console.log('--- Trying to compile failing C code ---'); const failedCompile = buildEnv.tryCompile('c', 'int main() { return z; }'); console.log(`Failed compile (as expected): ${failedCompile}`); } runChecks();
Debug
Known issues
gotchaThe package is currently at version 0.0.7, indicating a pre-release or early-stage development status. API stability is not guaranteed, and breaking changes may occur in future minor or patch releases.
fix
Consider pinning to an exact version (e.g., `"buildcheck": "0.0.7"`) and performing thorough testing before relying on this in production environments. Monitor for updates cautiously.
affects: 0.0.x
gotchaThis package is specifically designed for build environments directly supported by Node.js. Obsolete, exotic, or unsupported build environments and platforms (e.g., very old compilers or niche operating systems) might not be detected correctly or supported, potentially leading to build failures.
fix
Verify that your target build environment and compiler versions (e.g., gcc, clang, MSVC 2013+) meet the stated requirements. Consult Node.js documentation for officially supported platforms and toolchains.
affects: >=0.0.1
gotchaThe package appears to be CommonJS-only based on its examples (`require`). Directly using ESM `import` statements may not work without a CommonJS wrapper, transpilation, or specific Node.js configuration (e.g., `package.json` `"type": "module"` with `createRequire`).
fix
Always use `const BuildEnvironment = require('buildcheck');` for importing the module. If integrating into an ESM-only project, you might need to use `import { createRequire } from 'module'; const require = createRequire(import.meta.url); const BuildEnvironment = require('buildcheck');`
affects: >=0.0.1
Upgrade
Version history
0.0.7latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
13 hits · last 30 days
node
10
OpenAI (training)
1
Resources
buildcheck — npm install buildcheck · libregistry