1.6.0 • Published 4 years ago

jquery-folders v1.6.0

Weekly downloads
-
License
-
Repository
-
Last release
4 years ago

jQuery Orchestrator

Summary

NPM package, allowing you to deal with plugin development for jQuery by splitting your features in many files into a structured sub-tree. The orchestrator will parse your files and wrap your functions into a single access point, in a minified js file just ready for production.

Get started

Install the package

npm i jquery-orchestrator --save

Orchestrator.json structure

{
    "source":  "src",
    "out": {
        "dir": "out",
        "header": "Test header",
        "name": "Your_plugin_name",
        "minified": true
    }
}
  • source is the name of your code source directory ('src' by default)
  • out.dir is the name of the directory where the output files will be generated ('out' by default)
  • out.header is an optional tag to add a header text in your ouput file
  • out.name is required, it will be used to format your output files names and your wrapper function name
  • out.minified is optional, by default your output file will not be minified and your comments will not be removed

How does it work

Every feature of your plugin should be formatted as following:

/**
 * Your doc
 * 
 * @Feature (name=foo)
 */
function FooFunction() {
    return this.each(function() {
        $(this).text('foo');
        console.log('foo');
    });
}

The name is optional, by default your feature name will be the function name.

Be aware that your whole code (contained in your source directory) will be processed during the build, even if only your features will be accessible through jQuery.

It means you can build your code structure as you please, with some private files to factorize your logic for instance.

Build

Run jquery-orchestrator in the directory where your orchestrator.json is located.

1.6.0

4 years ago