scaffold

scaffolding library for node.js

 
var scaffolding = require('scaffolding');
 
 
scaffolding({
    input: {
        name: "What is your name?",
        address: "What is your address?",
        hasDog: "(confirm) Do you have a dog?"
    },
    buildfunction(ops)
    {
        console.log(ops.name);
        console.log(ops.address);
        console.log(ops.hasDog);//true 
    }
});
 

You can easily specify the type of input by adding (type-of-input) before the message. Like to:

 
scaffolding({
    input: {
        username: "(prompt) Username:",
        password: "(password) Password:",
        hasFriends: "(confirm) Do you have any friends?"
    }
});
 

(prompt) is the default option if you omit the type of input.

 
scaffolding({
    
    input: {
        projectName: {
            msg: "What is your project name?",
            defaultfunction(paramscallback)
            {
                callback(50);
            }
        },
        projectSrc: {
            msg: "What is your project located?",
            default: '/usr/local/bin'
        }
    }
});
 

scans the target directory for files, and replaces any template variables with the parameters given. The destination is where the files are written to.

 
scaffolding({
    params: {
        projectName: "What is your project name?"
    }
})
 

Or if your lazy like me, you can do something like this:

scaffolding({ input: { projectName: "What is your project name?", _src: "Where is your project located?", _dest: "Where do you want to write the project to?", }, build: scaffolding.fromDir })