addgears

Manage Addgears app and access API.


Keywords
addgears, pricer, web scraping, e-commerce, browser, node
License
MIT
Install
npm install addgears@0.1.1

Documentation

Addgears

Addgears is an application which provides a set of useful tools for e-commerce applications: pricing, web scraping, UI widgets, etc. Addgears is based on the node-webkit and is highly customizable. This package provides node.js integration with Addgears. It could be used to manage Addgears installation and extensions. The package also provides access to Addgears API and scripting. Another package - grunt-addgears provides tools to package different resources (HTML pages and node.js modules) for easy reuse in Addgears. The Karma Launcher for Addgears provides plug-in for Karma test runner, allowing for easy code testing. Together, these tools turn Addgears into open, standards compliant, node-webkit based development platform for rich desktop applications.

Any Addgears extension is the property of their respective developer. Addgears application is a completely free platform to run any extension. As Addgears is based on the node-webkit, anyone may use his HTML and Javascript skills along with well known open source projects to create such extension. And these extensions could be easily repackaged to run in any node.js and browser based environment.

Addgears application itself is just a set of different extensions. They are free for small business (less than 100 items). Addgears provides support and development services.

Installation

Make sure you have node.js installed. Install the package and then run the installation script:

npm install addgears
cd addgears
npm run installer

Installer script downloads and installs Addgears application, which alternatively could be installed manually using the installer.

Currently Addgears is officially supported only for Windows platform. As it is implemented on top of the cross-platform node-webkit, Addgears could be used on other platforms, but this requires certain technical skills. Just use Windows version and node-webkit binaries as a starting point.

Usage

All operations (including installation and uninstallation) could be performed using API provided by the package. To use this API directly require "addgears" first:

    var addgears = require('addgears');
    addgears.run(__filename); // execute current Node.js script in Addgears 

To execute script inside Addgears it should export the function which is invoked by Addgears (API is passed as the first parameter).

    module.exports = function (Addgears){
        var $ = Addgears.$; // JQuery
        Addgears.window.init(); // opens and maximizes application window
        $('body').append('<h1>Hello Addgears</h1>'); // just use JQuery to modify DOM 
    }

A script may invoke the other script or execute itself. See examples/hello-world.js as an example. You may run this script through node.js:

node examples/hello-world

The "addgears" package provides also access to other useful functions, allowing management and control over Addgears application. Use the source as the guidance.

Grunt

Common tasks could be automated using grunt. The package provides quite a few tasks, located in tasks directory. To use them in another module you should add grunt.loadNpmTasks('addgears') to your Gruntfile. Use this package Gruntfile as an example. It automates some common tasks, to use it install grunt-cli first:

cd addgears
npm install grunt-cli -g

Now, to reinstall application issue:

grunt install

This will download and install Addgears. To uninstall application (without package removal) use:

grunt uninstall

A program removal doesn't remove user data, just removes the program files. The grunt install and grunt uninstall command sequence could be used to effectively update Addgears version. Use grunt addgearsUnlinkData to actually clean user data.

To be used in Addgears, HTML pages should be first loaded to Addgears and node modules copied to the application directory. Use grunt-addgears to package resources and create update bundles. A grunt addgearsApplyUpdate command could be used to load resources.

    // addgearsApplyUpdate configuration
    addgearsApplyUpdate:{
            src:["c:/tmp/update"] // path to the update bundle
        }
    },

Addgears itself is just a set of extensions, loaded to node-webkit. To get the latest version of Addgears or to install custom extension, download the latest bundle using the grunt downloadUpdate command.

    downloadUpdate:{
        main:{
            update:"http://url-of-the update-bundle.zip" // update URL (by default the latest Addgears version is taken
            path:'update.zip'                
        }
    },

An update usually comes as a zipped file, which could be managed using standard copy and zip grunt tasks. After an update is loaded using the grunt addgearsApplyUpdate command, pages from the update could be loaded using the grunt addgearsRun task:

    addgearsRun:{
        main:{
            page:'pages/pricer/main.html' // path to the page
        },
    }

To get the update version run:

grunt version

To execute the script you also may use grunt. Just add some configuration:

    // addgearsRun task configuration
    addgearsRun:{
        hello:{
            src:'examples/hello-world.js' // script to execute               
        }
    } 

License

This package is licensed under MIT license, Addgears is licensed separately. To use it you must agree with the terms and conditions first.