grunt-init的使用

Grunt-init是一个用来自动创建项目的架构工具,它会建立一个完整的目录结构和一个基本的配置环境,当然具体文件和内容取决于所选择的模板

安装grunt-init

使用

 npm install -g grunt-init

-g 会添加grunt-init到环境变量,允许在任何地方运行grunt-init命令

获取帮助

grunt-init --help

以下是输出

grunt-init: Generate project scaffolding from a template. (v0.3.2)

Usage
 grunt-init [options] [template]

Options
    --help, -h  Display this help text.
    --no-color  Disable colored output.
   --debug, -d  Enable debugging mode for tasks that support it.
       --stack  Print a stack trace when exiting with a warning or fatal error.
   --force, -f  A way to force your way past warnings. Want a suggestion? Don‘t
                use this option, fix your code.
    --no-write  Disable writing files (dry run).
 --verbose, -v  Verbose mode. A lot more information output.
 --version, -V  Print the grunt version. Combine with --verbose for more info.

Available templates

(No templates found)

Templates that exist in the C:\Users\t\.grunt-init directory may be run with
"grunt-init TEMPLATE". Templates that exist in another location may be run with
"grunt-init /path/to/TEMPLATE". A template is a directory that must contain, at
the very minimum, a template.js file.

For more information, see http://gruntjs.com/project-scaffolding

从输出可用看出没有可用的模板

几个Grunt-init维护的模板

Grunt-init-commonjs

Grunt-init-gruntfile

Grunt-init-gruntplugin

Grunt-init-jquery

Grunt-init-node

时间: 2024-09-17 00:32:56

grunt-init的使用的相关文章

grunt入门讲解7:项目脚手架grunt-init

grunt-init是一个用于自动创建项目脚手架的工具.它会基于当前工作环境和你给出的一些配置选项构建一个完整的目录结构.至于其所生成的具体文件和内容,依赖于你所选择的模版和构建过程中你对具体信息所给出的配置选项. 注意:这个独立的程序曾经是作为Grunt内置的"init"任务而存在的. 安装 为了使用grunt-init,需要将其安装到全局环境中. npm install -g grunt-init这样就会把grunt-init命令安装到你的系统路径中,从而允许你在任何目录中都可以运

Grunt之项目脚手架

在网上搜了下,grunt这方面的教程挺少的,来去都是一些被频繁转载的文章.唉, 首先我们在全局环境中安装grunt-init. npm install -g grunt-init 来看看官方的文档,举几个例子,看看grunt-init是如何使用的: 1.使用grunt-init --help来获取程序帮助以及列出可用模板清单 2.使用grunt-init TEMPLATE基于可用模板创建一个项目 3.使用grunt-init /path/to/TEMPLATE基于任意其他目录中的可用模板创建 为

JavaScript 项目构建工具 Grunt 实践:安装和创建项目框架

 Grunt 是一个基于任务的 JavaScript 项目命令行构建工具,运行于 Node.js 平台.Grunt 能够从模板快速创建项目,合并.压缩和校验 CSS & JS 文件,运行单元测试以及启动静态服务器. 安装 Grunt 推荐 Windows 用户使用 Git Shell 来进行命令行操作.安装 Windows 桌面版 GitHub 的时候会自动安装 Git Shell. GitHub for Windows 下载地址:http://windows.github.com Grunt

使用Backbone.js, ExpressJS, node.js, MongoDB的web应用样板工程

这是web应用的一个完整的样板工程,用到了Backbone.js & Marionette, node.js & ExpressJS,MongoDB & Moogoose, Handlebars, Grunt.js, Bower和Browserify! 我建立了一个超级基础的单页面应用程序(SPA),就是一个简单的通讯录管理器, 但麻雀虽小,五脏俱全.我写这篇文章的目的是介绍一下这个应用所用到的整个技术栈:后端,数据,前端,工具和测试.主要包括下面这些技术: 后端: node.js

window 下如何安装ghost博客

1.安装nodejs # Node v0.12.x and v4.2+ LTS - supported 我本地安装的是4.2 安装其他版本可能提示系统不兼容 2.安装mysql 3.安装bower 4.安装git 5.git clone git://github.com/tryghost/ghost.git 6.cd ghost 7.npm install -g grunt-cli 8.复制ghost根目录下的config.example.js文件,更改文件名为 config.js,我已经根据我

【grunt】两小时入门

目录: 1. 用途和场景 2.Grunt插件 3.相关资源 4.环境安装 5.开始学习 5.1 一个新项目 5.2 生成package.json 5.3 在项目中安装grunt和相关插件 5.4 Gruntfile语法 5.4.1 配置任务 5.4.2 加载插件 5.4.3 注册任务 5.5 为我们的项目配置gruntfile.js 5.6 执行任务 6.后续学习 1. 用途和场景 jshint代码检查 代码合并 代码压缩--js/css/html都可以 SASS/LESS编译css watch

Grunt Bower构建前端

Grunt + Bower-前端构建利器 目前比较流行的WEB开发的趋势是前后端分离.前端采用重量级的Javascript框架,比如Angular,Ember等,后端采用restful API的Web Service服务,通过JSON格式进行数据交互. 对于后端服务语言来说,不论是Ruby的rake,Java中的Maven或Gradle,或是Scala中的SBT,他们都能够提供编译运行.运行测试.打包部署.依赖管理等功能.再加上强大的package系统,让它可以插拔式的使用很多强大的功能,像数据

关于grunt和gulp

grunt 是一套前端自动化工具,一个基于nodeJs的命令行工具,一般用于:① 压缩文件② 合并文件③ 简单语法检查 "自动化.对于需要反复重复的任务,例如压缩(minification).编译.单元测试.linting等,自动化工具可以减轻你的劳动,简化你的工作.当你在 Gruntfile 文件正确配置好了任务,任务运行器就会自动帮你或你的小组完成大部分无聊的工作." Grunt 基于 Node.js ,用 JS 开发,这样就可以借助 Node.js 实现跨系统跨平台的桌面端的操作

Grunt 认识

基本工作流: JS合并.JS压缩.CSS压缩.CSS Sprite.图片优化.测试.静态资源缓存(版本更新)... 基于工作流产生的工具: JSHint(jshint.com).CSSLint(csslint.net).jade(jade.tilab.com).coffeeScript(coffee-script.org/).requireJs/seaJs.compass/less/sass ... Grunt就是解决各种工具组合而形成系统工作流的解决方案 安装 nodeJs --> npm -

Grunt:任务自动管理工具(收藏+转载)

原文:http://javascript.ruanyifeng.com/tool/grunt.html 安装 命令脚本文件Gruntfile.js Gruntfile.js实例:grunt-contrib-cssmin模块 常用模块设置 grunt-contrib-jshint grunt-contrib-concat grunt-contrib-uglify grunt-contrib-copy grunt-contrib-watch 其他模块 参考链接 在Javascript的开发过程中,经