gear-lib

Collection of common Gear.js tasks

43 个版本
安装
npm install gear-lib
yarn add gear-lib
pnpm add gear-lib
bun add gear-lib
README

gear-lib

Collection of common Gear.js tasks

Useful tasks to lint, minify, and deploy assets.

Build Status

NPM

Installation

$ npm install gear-lib

Quick Examples

Deploy to S3

new Queue({registry: 'gear-lib'})
    .read(['foo.js', 'bar.js', 'baz.js'])
    .concat()
    .jslint({config: {nomen: true}})
    .jsminify()
    .s3({name: 'foobarbaz.js', client: {
        key: '<key>',
        secret: '<secret>',
        bucket: 'gearjs'
    }})
    .run();

Documentation

Tasks

Tasks

### jslint()

Lint Javascript files.

Arguments

  • options.config - Options for JSLint.

Example

.jslint({config: {nomen: true}})

### jshint()

Lint Javascript files.

Arguments

  • options.config - Options for JSHint.

Example

.jshint({config: {browser: true, eqeqeq: true}})
.jshint({configFile: '.jshintrc'})

### jsminify()

Minify Javascript files.

Arguments

  • options.config - Options for uglify-js.

Example

.jsminify()

### csslint()

Lint CSS files.

Arguments

  • options.config - Options for CSSLint.

Example

.csslint({config: {'duplicate-properties': true}})

### cssminify()

Minify CSS files.

Aliased as less()

Example

.cssminify()

// Compile LESS stylesheets without minifying
.less({compress: false})

### glob()

Read files using wildcards. See Glob package

Arguments

  • options.pattern - Glob pattern.
  • options.limit - Limit the amount of concurrently opened files.
  • options.options - Glob options.

Example

.glob({
    pattern: "*.js"
})

### s3()

Deploy file to S3.

Arguments

  • options.name - Filename to write to S3.
  • options.client.key - S3 key.
  • options.client.secret - S3 secret.
  • options.client.bucket - S3 bucket.

Example

 .s3({name: 'foobarbaz.js', client: {
    key: '<key>',
    secret: '<secret>',
    bucket: 'gearjs'
 }})

### dest()

Move one or more files to a destination.

Arguments

  • options.dir - File destination.
  • options.base - Base path for incoming files.
  • options.encoding - File encoding.

Example

.dest('path/of/destination')

// With more options
.dest({
  dir: 'path/of/destination',
  base: 'path/of'
})
版本列表
0.9.2 2014-11-13
0.9.1 2014-05-20
0.9.0 2014-05-08
0.8.15 2014-04-13
0.8.14 2014-03-25
0.8.12 2013-11-23
0.8.11 2013-11-18
0.8.9 2013-08-02
0.8.8 2013-03-11
0.8.7 2013-02-19
0.8.6 2012-12-13
0.8.5 2012-11-14
0.8.4 2012-09-13
0.8.3 2012-08-31
0.8.2 2012-08-29
0.8.1 2012-08-29
0.8.0 2012-08-29
0.7.10 2012-08-28
0.7.9 2012-08-27
0.7.8 2012-07-31
0.7.7 2012-07-13
0.7.6 2012-06-15
0.7.5 2012-06-15
0.7.4 2012-06-15
0.7.3 2012-06-13
0.7.2 2012-06-13
0.7.1 2012-06-13
0.7.0 2012-06-12
0.6.1 2012-06-11
0.6.0 2012-06-08
0.4.2 2012-06-07
0.4.1 2012-06-07
0.4.0 2012-06-07
0.3.0 2012-06-05
0.1.4 2012-05-29
0.1.3 2012-05-29
0.1.2 2012-05-25
0.1.1 2012-05-24
0.1.0 2012-05-23
0.0.6 2012-05-23
0.0.5 2012-05-22
0.0.4 2012-05-19
0.0.2 2012-05-18