{"_id":"buildcheck","_rev":"4658093","name":"buildcheck","description":"Build environment checking (a la autoconf) for node.js","dist-tags":{"latest":"0.0.7"},"maintainers":[{"name":"mscdex","email":"mscdex@mscdex.net"}],"time":{"modified":"2026-04-10T21:24:57.000Z","created":"2021-09-13T04:23:04.751Z","0.0.7":"2025-11-25T23:02:15.827Z","0.0.6":"2023-04-22T13:46:21.873Z","0.0.5":"2023-04-11T11:15:40.558Z","0.0.4":"2022-03-26T03:19:39.150Z","0.0.3":"2021-10-23T02:37:25.041Z","0.0.2":"2021-10-22T02:58:05.145Z","0.0.1":"2021-09-13T04:23:04.751Z"},"users":{},"author":{"name":"Brian White","email":"mscdex@mscdex.net"},"repository":{"type":"git","url":"git+ssh://git@github.com/mscdex/buildcheck.git"},"versions":{"0.0.7":{"name":"buildcheck","version":"0.0.7","author":{"name":"Brian White","email":"mscdex@mscdex.net"},"description":"Build environment checking (a la autoconf) for node.js","main":"./lib/index.js","engines":{"node":">=10.0.0"},"devDependencies":{"@mscdex/eslint-config":"^1.1.0","eslint":"^7.0.0"},"scripts":{"test":"node test/test.js","lint":"eslint --cache --report-unused-disable-directives --ext=.js .eslintrc.js lib","lint:fix":"npm run lint -- --fix"},"keywords":["build","autoconf","addons","compiler","environment"],"licenses":[{"type":"MIT","url":"http://github.com/mscdex/buildcheck/raw/master/LICENSE"}],"repository":{"type":"git","url":"git+ssh://git@github.com/mscdex/buildcheck.git"},"_id":"buildcheck@0.0.7","bugs":{"url":"https://github.com/mscdex/buildcheck/issues"},"homepage":"https://github.com/mscdex/buildcheck#readme","_integrity":"sha512-lHblz4ahamxpTmnsk+MNTRWsjYKv965MwOrSJyeD588rR3Jcu7swE+0wN5F+PbL5cjgu/9ObkhfzEPuofEMwLA==","_resolved":"https://github.com/mscdex/buildcheck/tarball/v0.0.7","_from":"https://github.com/mscdex/buildcheck/tarball/v0.0.7","_nodeVersion":"20.14.0","_npmVersion":"10.7.0","dist":{"shasum":"07a5e76c10ead8fa67d9e4c587b68f49e8f29d61","size":12914,"noattachment":false,"key":"/buildcheck/-/buildcheck-0.0.7.tgz","tarball":"http://registry.cnpm.dingdandao.com/buildcheck/download/buildcheck-0.0.7.tgz"},"_npmUser":{"name":"mscdex","email":"mscdex@mscdex.net"},"directories":{},"maintainers":[{"name":"mscdex","email":"mscdex@mscdex.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/buildcheck_0.0.7_1764111735647_0.37199171889877647"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-11-25T23:02:15.827Z","publish_time":1764111735827,"_source_registry_name":"default","_cnpm_publish_time":1764111735827},"0.0.6":{"name":"buildcheck","version":"0.0.6","author":{"name":"Brian White","email":"mscdex@mscdex.net"},"description":"Build environment checking (a la autoconf) for node.js","main":"./lib/index.js","engines":{"node":">=10.0.0"},"devDependencies":{"@mscdex/eslint-config":"^1.1.0","eslint":"^7.0.0"},"scripts":{"test":"node test/test.js","lint":"eslint --cache --report-unused-disable-directives --ext=.js .eslintrc.js lib","lint:fix":"npm run lint -- --fix"},"keywords":["build","autoconf","addons","compiler","environment"],"licenses":[{"type":"MIT","url":"http://github.com/mscdex/buildcheck/raw/master/LICENSE"}],"repository":{"type":"git","url":"git+ssh://git@github.com/mscdex/buildcheck.git"},"bugs":{"url":"https://github.com/mscdex/buildcheck/issues"},"homepage":"https://github.com/mscdex/buildcheck#readme","_id":"buildcheck@0.0.6","_integrity":"sha512-8f9ZJCUXyT1M35Jx7MkBgmBMo3oHTTBIPLiY9xyL0pl3T5RwcPEY8cUHr5LBNfu/fk6c2T4DJZuVM/8ZZT2D2A==","_resolved":"https://github.com/mscdex/buildcheck/tarball/v0.0.6","_from":"https://github.com/mscdex/buildcheck/tarball/v0.0.6","_nodeVersion":"18.12.1","_npmVersion":"8.19.2","dist":{"shasum":"89aa6e417cfd1e2196e3f8fe915eb709d2fe4238","size":12787,"noattachment":false,"key":"/buildcheck/-/buildcheck-0.0.6.tgz","tarball":"http://registry.cnpm.dingdandao.com/buildcheck/download/buildcheck-0.0.6.tgz"},"_npmUser":{"name":"mscdex","email":"mscdex@mscdex.net"},"directories":{},"maintainers":[{"name":"mscdex","email":"mscdex@mscdex.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/buildcheck_0.0.6_1682171181677_0.4308727908755121"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-04-22T13:46:21.873Z","publish_time":1682171181873,"_cnpm_publish_time":1682171181873},"0.0.5":{"name":"buildcheck","version":"0.0.5","author":{"name":"Brian White","email":"mscdex@mscdex.net"},"description":"Build environment checking (a la autoconf) for node.js","main":"./lib/index.js","engines":{"node":">=10.0.0"},"devDependencies":{"@mscdex/eslint-config":"^1.1.0","eslint":"^7.0.0"},"scripts":{"test":"node test/test.js","lint":"eslint --cache --report-unused-disable-directives --ext=.js .eslintrc.js lib","lint:fix":"npm run lint -- --fix"},"keywords":["build","autoconf","addons","compiler","environment"],"licenses":[{"type":"MIT","url":"http://github.com/mscdex/buildcheck/raw/master/LICENSE"}],"repository":{"type":"git","url":"git+ssh://git@github.com/mscdex/buildcheck.git"},"bugs":{"url":"https://github.com/mscdex/buildcheck/issues"},"homepage":"https://github.com/mscdex/buildcheck#readme","_id":"buildcheck@0.0.5","_integrity":"sha512-jYWpRy8eedl/JZqkOeq0X0bNcaK04hXKhIi4gYsDKZUJWRjJJWViYfsMXO0BJQ40zSLcdLoa+iqe48Kz2PtQag==","_resolved":"https://github.com/mscdex/buildcheck/tarball/v0.0.5","_from":"https://github.com/mscdex/buildcheck/tarball/v0.0.5","_nodeVersion":"18.12.1","_npmVersion":"8.19.2","dist":{"shasum":"5b7c0830b25dc61422032eeb5c18bfcaa9eebb8d","size":12690,"noattachment":false,"key":"/buildcheck/-/buildcheck-0.0.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/buildcheck/download/buildcheck-0.0.5.tgz"},"_npmUser":{"name":"mscdex","email":"mscdex@mscdex.net"},"directories":{},"maintainers":[{"name":"mscdex","email":"mscdex@mscdex.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/buildcheck_0.0.5_1681211740366_0.12050911821167953"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-04-11T11:15:40.558Z","publish_time":1681211740558,"_cnpm_publish_time":1681211740558},"0.0.4":{"name":"buildcheck","version":"0.0.4","author":{"name":"Brian White","email":"mscdex@mscdex.net"},"description":"Build environment checking (a la autoconf) for node.js","main":"./lib/index.js","engines":{"node":">=10.0.0"},"devDependencies":{"@mscdex/eslint-config":"^1.1.0","eslint":"^7.0.0"},"scripts":{"lint":"eslint --cache --report-unused-disable-directives --ext=.js .eslintrc.js lib","lint:fix":"npm run lint -- --fix"},"keywords":["build","autoconf","addons","compiler","environment"],"licenses":[{"type":"MIT","url":"http://github.com/mscdex/buildcheck/raw/master/LICENSE"}],"repository":{"type":"git","url":"git+ssh://git@github.com/mscdex/buildcheck.git"},"_resolved":"","_integrity":"","_from":"https://github.com/mscdex/buildcheck/tarball/v0.0.4","bugs":{"url":"https://github.com/mscdex/buildcheck/issues"},"homepage":"https://github.com/mscdex/buildcheck#readme","_id":"buildcheck@0.0.4","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"shasum":"01b78c9e595629a4982956eb6cfd98359afb9d76","size":12416,"noattachment":false,"key":"/buildcheck/-/buildcheck-0.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/buildcheck/download/buildcheck-0.0.4.tgz"},"_npmUser":{"name":"mscdex","email":"mscdex@mscdex.net"},"directories":{},"maintainers":[{"name":"mscdex","email":"mscdex@mscdex.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/buildcheck_0.0.4_1648264778986_0.7520032376978061"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-03-26T03:19:42.886Z","publish_time":1648264779150,"_cnpm_publish_time":1648264779150},"0.0.3":{"name":"buildcheck","version":"0.0.3","author":{"name":"Brian White","email":"mscdex@mscdex.net"},"description":"Build environment checking (a la autoconf) for node.js","main":"./lib/index.js","engines":{"node":">=10.0.0"},"devDependencies":{"@mscdex/eslint-config":"^1.1.0","eslint":"^7.0.0"},"scripts":{"lint":"eslint --cache --report-unused-disable-directives --ext=.js .eslintrc.js lib","lint:fix":"npm run lint -- --fix"},"keywords":["build","autoconf","addons","compiler","environment"],"licenses":[{"type":"MIT","url":"http://github.com/mscdex/buildcheck/raw/master/LICENSE"}],"repository":{"type":"git","url":"git+ssh://git@github.com/mscdex/buildcheck.git"},"_resolved":"","_integrity":"","_from":"https://github.com/mscdex/buildcheck/tarball/v0.0.3","bugs":{"url":"https://github.com/mscdex/buildcheck/issues"},"homepage":"https://github.com/mscdex/buildcheck#readme","_id":"buildcheck@0.0.3","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"shasum":"70451897a95d80f7807e68fc412eb2e7e35ff4d5","size":12331,"noattachment":false,"key":"/buildcheck/-/buildcheck-0.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/buildcheck/download/buildcheck-0.0.3.tgz"},"_npmUser":{"name":"mscdex","email":"mscdex@mscdex.net"},"directories":{},"maintainers":[{"name":"mscdex","email":"mscdex@mscdex.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/buildcheck_0.0.3_1634956644889_0.278232070219929"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2021-12-27T20:38:04.792Z","publish_time":1634956645041,"_cnpm_publish_time":1634956645041},"0.0.2":{"name":"buildcheck","version":"0.0.2","author":{"name":"Brian White","email":"mscdex@mscdex.net"},"description":"Build environment checking (a la autoconf) for node.js","main":"./lib/index.js","engines":{"node":">=10.0.0"},"devDependencies":{"@mscdex/eslint-config":"^1.1.0","eslint":"^7.0.0"},"scripts":{"lint":"eslint --cache --report-unused-disable-directives --ext=.js .eslintrc.js lib","lint:fix":"npm run lint -- --fix"},"keywords":["build","autoconf","addons","compiler","environment"],"licenses":[{"type":"MIT","url":"http://github.com/mscdex/buildcheck/raw/master/LICENSE"}],"repository":{"type":"git","url":"git+ssh://git@github.com/mscdex/buildcheck.git"},"_resolved":"","_integrity":"","_from":"https://github.com/mscdex/buildcheck/tarball/v0.0.2","bugs":{"url":"https://github.com/mscdex/buildcheck/issues"},"homepage":"https://github.com/mscdex/buildcheck#readme","_id":"buildcheck@0.0.2","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"shasum":"db0ae2d4067b1c91618fc6b470eae235ff17cc96","size":12293,"noattachment":false,"key":"/buildcheck/-/buildcheck-0.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/buildcheck/download/buildcheck-0.0.2.tgz"},"_npmUser":{"name":"mscdex","email":"mscdex@mscdex.net"},"directories":{},"maintainers":[{"name":"mscdex","email":"mscdex@mscdex.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/buildcheck_0.0.2_1634871484977_0.3103629551650462"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2021-12-27T20:38:03.892Z","publish_time":1634871485145,"_cnpm_publish_time":1634871485145},"0.0.1":{"name":"buildcheck","version":"0.0.1","author":{"name":"Brian White","email":"mscdex@mscdex.net"},"description":"Build environment checking (a la autoconf) for node.js","main":"./lib/index.js","engines":{"node":">=10.0.0"},"devDependencies":{"@mscdex/eslint-config":"^1.1.0","eslint":"^7.0.0"},"scripts":{"lint":"eslint --cache --report-unused-disable-directives --ext=.js .eslintrc.js lib","lint:fix":"npm run lint -- --fix"},"keywords":["build","autoconf","addons","compiler","environment"],"licenses":[{"type":"MIT","url":"http://github.com/mscdex/buildcheck/raw/master/LICENSE"}],"repository":{"type":"git","url":"git+ssh://git@github.com/mscdex/buildcheck.git"},"_resolved":"","_integrity":"","_from":"https://github.com/mscdex/buildcheck/tarball/v0.0.1","bugs":{"url":"https://github.com/mscdex/buildcheck/issues"},"homepage":"https://github.com/mscdex/buildcheck#readme","_id":"buildcheck@0.0.1","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"shasum":"64af6f1a138c9b8532ca6407750c9aae7a09d95a","size":4266,"noattachment":false,"key":"/buildcheck/-/buildcheck-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/buildcheck/download/buildcheck-0.0.1.tgz"},"_npmUser":{"name":"mscdex","email":"mscdex@mscdex.net"},"directories":{},"maintainers":[{"name":"mscdex","email":"mscdex@mscdex.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/buildcheck_0.0.1_1631506984609_0.7975404344347068"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2021-12-27T20:38:02.996Z","publish_time":1631506984751,"_cnpm_publish_time":1631506984751}},"readme":"# Description\n\nBuild environment checking for [node.js](http://nodejs.org/).\n\nThis allows for autoconf-like functionality for node addons/build scripts.\n\n**Note:** Obsolete and/or exotic build environments or platforms not supported\nby node.js are not supported.\n\n## Requirements\n\n* [node.js](http://nodejs.org/) -- v10.0.0 or newer\n* Supported compilers:\n  * gcc\n  * clang\n  * MSVC 2013+ and Windows SDK 8.1+\n\n## Installation\n\n    npm install buildcheck\n\n## Examples\n\n### Check if a C function exists\n\n```js\n'use strict';\n\nconst BuildEnvironment = require('buildcheck');\n\nconst buildEnv = new BuildEnvironment();\n\nconsole.log(buildEnv.checkFunction('c', 'preadv2'));\n```\n\n### Check if a C header is usable\n\n```js\n'use strict';\n\nconst BuildEnvironment = require('buildcheck');\n\nconst buildEnv = new BuildEnvironment();\n\nconsole.log(buildEnv.checkHeader('c', 'linux/io_uring.h'));\n```\n\n### Try to compile some C code\n\n```js\n'use strict';\n\nconst BuildEnvironment = require('buildcheck');\n\nconst buildEnv = new BuildEnvironment();\n\n// Should be a successful compile\nconsole.log(buildEnv.tryCompile('c', 'int main() { return 0; }'));\n\n// Should be a failed compile\nconsole.log(buildEnv.tryCompile('c', 'int main() { return z; }'));\n```\n\n## API\n\n### Exports\n\nThe exported value is `BuildEnvironment`, the main class for dealing with a build environment.\n\n### BuildEnvironment\n\n#### Methods\n\n* **(constructor)**([< _object_ >config]) - Creates and returns a new BuildEnvironment instance. `config` may contain:\n\n  * **compilerC** - _string_ - C compiler command to use. *Note: this is ignored on Windows.* **Default:** `process.env.CC` or `'cc'`\n\n  * **compilerCXX** - _string_ - C++ compiler command to use. *Note: this is ignored on Windows.* **Default:** `process.env.CXX` or `'c++'`\n\n  * **msvs_version** - _mixed_ - A string or number containing the year of the Visual Studio compiler to use. *Note: this is for Windows only.* **Default:** newest version installed\n\n* **checkDeclared**(< _string_ >lang, < _string_ >symbolName[, < _object_ >options]) - _boolean_ - Checks if a symbol `symbolName` is declared where `lang` is either `'c'` or `'c++'`. Returns `true` if symbol exists, `false` otherwise. `options` may contain:\n\n  * **headers** - _array_ - A list of headers to try when checking if the symbol is declared. `checkFunction()` will always first try without a library. If not supplied, a default list of common (platform-specific) headers will be used.\n\n  * **searchLibs** - _array_ - A list of library names (without the `'-l'` prefix) to try when checking if the symbol is declared. `checkDeclared()` will always first try without a library.\n\n* **checkFunction**(< _string_ >lang, < _string_ >functionName[, < _object_ >options]) - _boolean_ - Checks if a function `functionName` exists and is linkable where `lang` is either `'c'` or `'c++'`. Returns `true` if function exists, `false` otherwise. `options` may contain:\n\n  * **searchLibs** - _array_ - A list of library names (without the `'-l'` prefix) to try when checking for this function. `checkFunction()` will always first try without a library.\n\n* **checkFeature**(< _string_ >featureName) - _mixed_ - Executes a special test for a \"feature\" and returns the result. Supported values for `featureName`:\n\n  * `'strerror_r'` - Returns an object containing:\n\n    * `declared` - _boolean_ - Whether `strerror_r()` is declared\n\n    * `returnsCharPtr` - _boolean_ - If `strerror_r()` is declared, whether it returns `char*` (a GNU extension) or not.\n\n* **checkHeader**(< _string_ >lang, < _string_ >headerName) - _boolean_ - Checks if the header `headerName` exists and is usable where `lang` is either `'c'` or `'c++'`. Returns `true` if the header exists and is usable, `false` otherwise.\n\n* **defines**([< _string_ >lang[, < _boolean_ >rendered]]) - _array_ - Returns a list of features, functions, headers, and symbols known to be defined by this build environment instance. `lang` is either `'c'` or `'c++'` If `lang` is not set, defines for both `'c'` and `'c++'` will be returned. If `rendered` is `true` (defaults to `false`), autoconf-style defines (e.g. \"HAVE_FOO=1\") will be returned instead. Defines coming from features utilize base strings/names from autoconf for better compatibility.\n\n* **libs**([< _string_ >lang]) - _array_ - Returns a list of (`'-l'`-prefixed) libraries known to be required for features and functions defined by this build environment instance. `lang` is either `'c'` or `'c++'` If `lang` is not set, defines for both `'c'` and `'c++'` will be returned.\n\n* **tryCompile**(< _string_ >lang, < _string_ >code[, < _array_ >compilerParams]) - _mixed_ - Attempts to compile `code` where `lang` is either `'c'` or `'c++'`. `compilerParams` is an optional array of compiler/linker flags to include. Returns `true` on successful compilation, or an _Error_ instance with an `output` property containing the compiler error output.\n","_attachments":{},"homepage":"https://github.com/mscdex/buildcheck#readme","bugs":{"url":"https://github.com/mscdex/buildcheck/issues"}}