# ptap

> pafang assets build tool.

Latest version **0.1.1** (published 2015-01-14) · 0 weekly downloads

## Install

```sh
npm install ptap
pnpm add ptap
yarn add ptap
bun add ptap
```

Provides the command `ptap`.

## Health

**Score 10/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2015-01-14 |
| First published | 2015-01-07 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.8.0 |
| Dependencies | 16 |
| Known vulnerabilities | 0 (+2 in 2 direct dependencies) |
| Install scripts | yes |
| GitHub stars | 0 |
| Author | 水木年华double |
| Maintainers | shmnh_double |
| Keywords | paf, ptap, asset, publish |

## Links

- npm: https://www.npmjs.com/package/ptap
- Repository: git@github.com:shmnhdouble2013/ptap
- Homepage: https://github.com/shmnhdouble2013/ptap
- Issues: https://github.com/shmnhdouble2013/ptap/issues
- npm.io page: https://npm.io/package/ptap

## Dependencies (16)

- [walk](https://npm.io/package/walk.md) 2.2.x
- [async](https://npm.io/package/async.md) *
- [cssom](https://npm.io/package/cssom.md) *
- [iwalk](https://npm.io/package/iwalk.md) *
- [mocha](https://npm.io/package/mocha.md) *
- [colors](https://npm.io/package/colors.md) *
- [node-kpc](https://npm.io/package/node-kpc.md) *
- [optimist](https://npm.io/package/optimist.md) *
- [clean-css](https://npm.io/package/clean-css.md) 1.1.x
- [commander](https://npm.io/package/commander.md) 1.3.x
- [jschardet](https://npm.io/package/jschardet.md) *
- [node-file](https://npm.io/package/node-file.md) *
- [uglify-js](https://npm.io/package/uglify-js.md) 2.4.x
- [iconv-lite](https://npm.io/package/iconv-lite.md) *
- [underscore](https://npm.io/package/underscore.md) *
- [native2ascii](https://npm.io/package/native2ascii.md) *

## Alternatives

- [ext-list](https://npm.io/package/ext-list.md) — 6.3M weekly downloads
- [@lexical/selection](https://npm.io/package/@lexical/selection.md) — 3.8M weekly downloads
- [@lexical/text](https://npm.io/package/@lexical/text.md) — 3.6M weekly downloads
- [@lexical/clipboard](https://npm.io/package/@lexical/clipboard.md) — 3.0M weekly downloads
- [@tiptap/extension-mention](https://npm.io/package/@tiptap/extension-mention.md) — 3.0M weekly downloads

## Recent versions

- 0.1.1 (latest) — 2015-01-14
- 0.1.0 — 2015-01-07

## README

# ptap

前端工具集。


## 安装

#### 一、安装grunt命令行工具

    npm install -g grunt-cli

    ps: mac 系统 可能需要sudo权限
        
#### 二、安装grunt
首先在你的项目根目录下创建一个名为package.json的文件，并且设置name、version和devDependencies等字段，例如：

    {
      "name": "your-project-name",
      "version": "1.0.0",
      "devDependencies": {
        "grunt": "~0.4.2"
      }
    }
    
然后在项目根目录下执行

    npm install --save-dev grunt

#### 三、安装grunt-ptap插件
同样在项目根目录下执行

    npm install --save-dev grunt-ptap
		  

## 使用

#### 一、添加Gruntfile.js
在项目根目录下创建Gruntfile.js，进行插件加载和配置
    
    module.exports = function(grunt){

        //读取package.json
        var pkg = require('./package.json');                
            
        //配置任务
        grunt.initConfig({
            ptap:{
                buildcfg: {
                    options: {
                        name: pkg.name, //包名
                        version: pkg.version //版本
                    },
                    src: ['src/**/*.js']
                },
                build: {
                    options: {
                        compress: true
                    }
                }
            }
        });
        
        //加载grunt-ptap插件
        grunt.loadNpmTasks('grunt-ptap');
        		
        //注册一个默认任务
        grunt.registerTask('default', ['ptap']);        
    }

## grunt-ptap配置

#### buildcfg

buildcfg任务用于生成包的配置文件，配置文件用于让脚本在use的时候告诉kissy应当去加载哪个模块，配置项：

* name : 包名，模块的前缀，例如: haofang，建议使用 仓库名(应用名字)
* version : 发布版本号，建议从package.json中读取
* baseurl : 包的url前缀(资源库域名)，默认是 http://static.**.com/

#### build

    ptap build

build任务用于进行ascii化、文件压缩、文件编译等源码处理工作，配置项：  

* compress: 是否进行压缩，默认为true

---
_Source: https://npm.io/package/ptap · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
