|
6 gadi atpakaļ | |
---|---|---|
.. | ||
test | 6 gadi atpakaļ | |
.npmignore | 6 gadi atpakaļ | |
README.md | 6 gadi atpakaļ | |
index.js | 6 gadi atpakaļ | |
package.json | 6 gadi atpakaļ |
#Description Decode base64 to image and save the image to disk.
#base64-to-image
To install
npm install base64-to-image --save
To run test
npm test
Require the library in your .js file
var base64ToImage = require('base64-to-image');
var base64Str = "Add valid base64 str";
var path ='put a valid path where you want to save the image';
var optionalObj = {'fileName': 'imageFileName', 'type':'png'};
base64ToImage(base64Str,path,optionalObj);
Note base64ToImage function returns imageInfo which is an object with imageType and fileName.
var imageInfo = base64ToImage(base64Str,path,optionalObj);
base64Str
(string) - base64 string.path
(string) - a valid path where you want to save the image.optionalObj
(object) - have three properties fileName, type and debug
Anyone can contribute and use it
Report a bug in the issues.