gyp-builder allows you to generate and build gyp files (for node or python) programmatically. It's useful for projects where you have some boilerplate code, and you want to create a new project with a specially configured gyp file.
Installation
npm install gyp-builder
Usage
// We want to create a new project in a folder. We need to settle on a // project name, so that the builder can setup files and folders accordinglyvar projectName = "TestProject" // First we need to create our builder. It comes with an empty gyp 'skeliton' loaded.var builder = require("gyp-builder").createBuilder( projectName, false ); // Create two target objectsvar firstTarget = { 'target_name': 'testTarget1', 'type': '<(library)'} var secondTarget = { 'target_name': 'testTarget2', 'type': 'executable'} // Set our targetsbuilder.setTarget( firstTarget );builder.setTarget( secondTarget ); // Write the gyp file to disk// With no arguments, this creates the file in the current working directorybuilder.writeGypFile( __dirname + "/" + projectName + "/" ); // Build the gyp stuff!builder.build();