Skip to content

Function: createAllowBinariesBuilder() ​

ts
function createAllowBinariesBuilder(binaries): AstBuilder<NodeAllowBinariesNode> & NodeAllowBinariesNode;

Defined in: node/src/builders/create-allow-binaries-builder.ts:15

Creates a policy guard builder and passive AST node restricting subprocess binaries (local.allowBinaries).

Compiles to a frozen NodeAllowBinariesNode (type: 'node:allow-binaries') that rejects any subprocess invocation whose binary name or basename is absent from binaries.

Parameters ​

ParameterTypeDescription
binariesreadonly string[]Allowed executable binary names.

Returns ​

AstBuilder<NodeAllowBinariesNode> & NodeAllowBinariesNode

Frozen allow-binaries guard builder and AST node.

Throws ​

If binaries is empty or contains an empty string.

Released under the MIT License.