json-images-saver
Save to files all base64 images contained in the json
It can be easily integrated with the output of static site creator
Features
- gulp support (with multiple json files support)
- gulp steam support
- laravel elixir support
- support of angular-base64-upload export (default options)
- custom base 64 pattern
- any name support
- any name support for multiple keys
- delete old images as option (in gulp version)
TODO
- test wrong cases for base64_structure
- travis integration
- elixir notify
- remove old dir when dir name is changed
Examples
Elixir
"use strict";var elixir = ;;var gulp = ;;
Elixir with pug
"use strict";var elixir = ;;;var fs = ;var gulp = ;var through = ;var args = argv;{this_list = ;thisdata = {};}{if!name in this_listthis;trythis_listname = JSON;catchethis_listname = json;}{var _this = this;Object;}{return {// Creating a stream through which each file will passvar stream = through;stream;return stream;}}var jsonCollection = ;var pugVars = locked:true;;
- locked is used in pug file to lock the compilation until the json is ready, this way is needed because we have to call elixir-pug at the begining to initialize it (to create the gulp task)
- the timeout is needed to start jsonImagesSaver the first time, to have data to pass pug (they are stored only in the memory)