#!/usr/bin/env node var fs = require('fs-extra'), path = require('path'), pkg = require('../package.json'), version = pkg.version, npm = require('npm'), dir = path.dirname(); // install gulp modules npm.load(function (err) { // catch errors npm.commands.install(['gulp', 'gulp-sass', 'gulp-browserify', 'gulp-uglify', 'gulp-jshint', 'gulp-minify-css', 'gulp-notify', 'gulp-rename', 'gulp-replace', 'jshint-stylish'], function (err, data) { // log the error or data }); npm.on('log', function (message) { // log the progress of the installation console.log(message); }); }); // copy gulpfile over fs.readFile(path.join(__dirname, '../gulpfile.js'), 'utf8', function (err,data) { if (err) { return console.log(err); } write('gulpfile.js', data); }); function write(path, str, mode) { fs.writeFileSync(path, str, { mode: mode || 0666 }); console.log(' \x1b[36mcreate\x1b[0m : ' + path); } console.log('Gulp Boilerplate created ' + version);