0.0.19 • Published 4 years ago

banner-packager v0.0.19

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

Allows developer to use shared folder, also creates zips for upload to Ad server or Banner Share and a file weight report.

This script requires a configuration file, this file allows you to set the name format and other details once and not get prompted each time you want to run this.

config.json:

{  
    "name": "Company-MyDruga-{f}-Sunny-Day-{wxh}-{YYYY}.{MM}.{DD}",  
    "maxBannerKB": 100,  
    "maxBackupKB": 40,
    "maxImageOnlyKB":30,  OPTIONAL
    "backup_in_zip":false  
}
  • "name": - This is the name for the backup image and the zip file.
    • Some flags are available to insert the dimensions, date and special words, only the dimension flag ("{wxh}") is required, the others are optional.
      • {wxh} REQUIRED - This will be replaced with the banner dimensions extracted from the banner folder name.
        • for example: If your folder is called "300x250", the name of the zips and backup images will be Company-MyDruga-Sunny-Day-300x250
      • {YYYY} or {YY} - This will be replaced with the current four digit or two digit year.
        • for example: If you run the script on January 15, 2020, the name of the zips and backup images will be Company-MyDruga-Sunny-Day-2020
      • {MM} - This will be replaced with the current two digit month.
        • for example: If you run the script on January 15, 2020, the name of the zips and backup images will be Company-MyDruga-Sunny-Day-01
      • {DD} - This will be replaced with the current two digit day.
        • for example: If you run the script on January 15, 2020, the name of the zips and backup images will be Company-MyDruga-Sunny-Day-15
      • {f} - this is for a flag piece of text. Let's says that you have two banners that are both 300x250 but one is national, the other is specific to Colorado.
        • Name the folders 300x250 (for the national banner) and 300x250_Colorado (for the Colorado banner). The text after the underscore is our flag text
          • for example: If your folder has an underscore, the {f} will be replaced with the text following the underscore.
            • The 300x250 will be named Company-MyDruga-Sunny-Day-300x250
            • The 300x250_Colorado will be named Company-MyDruga-Colorado-Sunny-Day-300x250
  • "maxBannerKB": - Put the maximum allowed file weight in KB here, if the banner exceeds this value you will be notified. ex.: 200
  • "maxBackupKB": - Put the maximum allowed file weight for the backup image in KB here, if the backup image exceeds this value you will be notified. ex.: 40
  • "maxImageOnlyKB": OPTIONAL - Put the maximum allowed file weight for the image-only banner(s) in KB here, if the image exceeds this value you will be notified. ex.: 30
  • "backup_in_zip":
    • If true this will include the backup image inside of the zip.
    • if false the backup image will be added to the ~upload folder outside of the zip.
      • In both cases the file weight of the backup is not included in the file weight report and the backup image will be renamed.

To include an image-only file
Place the image(s) in the root of your project, make sure your config.json file includes the "maxImageOnlyKB" setting.

To use the shared folder feature
Files that are used in every HTML banner in your banner set can be placed in a shared folder. When packaged those files will be copied to each banner. This feature is optional but helps to ensure consistency. Examples of files would be the ad server file (dcm.js for example) intouch.js, isi.js and isiText.js. Images and css files can also be shared if it helps.
In you project folder create a folder for each banner size just like always

160x600/  
	images/  
		image1.png  
		cta.png  
	scripts/  
		main.js  
	styles/  
		main.css  
300x250/ ...  
300x600/ ...  
728x90/ ...  

Normally you would put files like dcm.js, intouch.js and isi.js inside a 'lib' folder inside of the 'scripts' folder. Since these three files are shared by every banner in this set, you can use the shared folder:
Create a folder called '~shared', create the subfolders like you would in a regular banner folder:

~shared/  
	images/  
		logo.svg  
	scripts/  
		lib/  
			intouch.js  
			dcm.js  
			isi.js  
		isiText.js  

In your banner HTML and CSS, reference these files with the full shared folder path:
<script src="../~shared/scripts/lib/dcm.js"></script>
When you run 'banner-packager' at the terminal these files will be packaged together as normal and the HTML and css paths will be corrected:
<script src="scripts/lib/dcm.js"></script>
Once banner-packager is finished your zip will contain the following folder/file structure

160x600/  
	images/  
		image1.png  
		cta.png  
		logo.svg  
	scripts/  
		lib/  
			intouch.js  
			dcm.js  
			isi.js  
		isiText.js  
		main.js  
	styles/  
		main.css  

TO DO
Allow a switch for 'HTML'/'STATIC' in file name: Bannerstatic_size_campaign_name_HCP VS BannerHTML_size_campaign_name_HCP

0.0.19

4 years ago

0.0.18

4 years ago

0.0.17

4 years ago

0.0.16

4 years ago

0.0.15

4 years ago

0.0.10

4 years ago

0.0.11

4 years ago

0.0.12

4 years ago

0.0.13

4 years ago

0.0.14

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago