Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Collection of common Gear.js tasks
JavaScript
Tree: 2fe276d112

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
build
lib
test
vendor
.gitignore
.travis.yml
LICENSE
Makefile
README.md
bootstrap.js
index.js
package.json

README.md

gear-lib

Collection of common Gear.js tasks

Useful tasks to lint, minify, and deploy assets.

Build Status

Installation

$ npm install gear-lib

Quick Examples

Deploy to S3

new Queue({registry: new Registry({module: '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}})

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})

replace()

Replace strings using RegExp.

Arguments

  • options.regex - RegExp object or string.
  • options.flags - RegExp flags if using string.

Example

.replace({
    regex: "Y.log\\(.+?\\);?",
    replace: '',
    flags: 'mg'
})

.replace({
    regex: /Y.log\(.+?\);?/mg,
    replace: ''
})

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'
 }})
Something went wrong with that request. Please try again.