UNPKG

1.67 kBMarkdownView Raw
1# gcc-min
2Just write scripts for Node.js environment, then build to use in the browsers.
3
4[![NPM](https://badge.fury.io/js/gcc-min.svg)](https://badge.fury.io/js/gcc-min)
5[![Build Status](https://travis-ci.org/ndaidong/gcc-min.svg?branch=master)](https://travis-ci.org/ndaidong/gcc-min)
6[![codecov](https://codecov.io/gh/ndaidong/gcc-min/branch/master/graph/badge.svg)](https://codecov.io/gh/ndaidong/gcc-min)
7[![Dependency Status](https://gemnasium.com/badges/github.com/ndaidong/gcc-min.svg)](https://gemnasium.com/github.com/ndaidong/gcc-min)
8[![NSP Status](https://nodesecurity.io/orgs/techpush/projects/1423652f-9450-40d0-9df6-1d54b2312441/badge)](https://nodesecurity.io/orgs/techpush/projects/1423652f-9450-40d0-9df6-1d54b2312441)
9
10
11## Usage
12
13Install:
14
15```
16npm install gcc-min
17```
18
19Run command to build:
20
21```
22gccmin --entry entryFile --name moduleName --output outputDir --package pathToPackageJSONFile
23
24// or
25gccmin -e entryFile -n moduleName -o outputDir -p pathToPackageJSONFile
26```
27
28Or Node APIs
29
30```
31var gccmin = require('gcc-min');
32
33gccmin(path entryFile, String moduleName, path outputDir, Object config);
34
35```
36
37`config` is a JavaScript object which contain the meta data info to insert into the output files. It may be extracted from package.json file.
38
39
40The config object must provide the following properties:
41
42```
43{
44 name: String,
45 version: String in semver format, e.g: '1.2.3'
46 author: String,
47 repository: Object {
48 type: 'git',
49 url: "https://github.com/username/reponame"
50 },
51 license: String
52}
53
54```
55
56
57## Test
58
59```
60git clone https://github.com/ndaidong/gcc-min.git
61cd gcc-min
62npm install
63npm test
64```
65
66# License
67
68The MIT License (MIT)