0.0.2 • Published 9 years ago

abc-script-loader v0.0.2

Weekly downloads
13
License
-
Repository
github
Last release
9 years ago

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