abc-script-loader

0.0.2 • Public • Published

Build Status

abc-script-manager

CLI tool for managing scripts based on a config

Usage
Define your config in abc-config.json.

npm link
abcsm make

Templates
Standard javascript. use parameters where you want ur config parameters to be used
The name of each function must be used as name in the scripts array in the config if u want to call this function.

Sample (trackme.js):

var trackme = function(trackid) {
    console.log(trackid);	
};

Config
JSON format. In project root.
Named abc-config.json

Sample:

{
    "name": "abctags",
    "basepath": "./www/",
    "backup": "./.backup/",
    "apps": [
        {
            "id": "abcnyheter",
            "scripts": [
                {
                    "name": "trackme",
                    "template": "./templates/trackme.js",
                    "params": [
                        "1992"
                    ]
                },
                {
                    "name": "trackmore",
                    "template": "./templates/trackmore.js",
                    "params": [
                        1992"
                    ]
                }
            ]
        }
    ]
}

Result
The result is written to the folder you defined as basepath in your config.
And it will be named whatever name you defined in your config, and be a js file.

./www/abctags.js

Readme

Keywords

none

Package Sidebar

Install

npm i abc-script-loader

Weekly Downloads

3

Version

0.0.2

License

none

Last publish

Collaborators

  • glenn.abrahamsen