image-to-base64
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -0,0 +0,0 @@ "use strict"; |
{ | ||
"name": "image-to-base64", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Generate a image to base64.", | ||
@@ -14,11 +14,18 @@ "main": "index.js", | ||
"keywords": [ | ||
"image", | ||
"to", | ||
"base64", | ||
"image", | ||
"base64", | ||
"node", | ||
"nodejs", | ||
"module convert base64 nodejs", | ||
"image2base64", | ||
"image-to-base64", | ||
"convert-image-base64", | ||
"convert", | ||
"image", | ||
"save", | ||
"code" | ||
"code", | ||
"base64", | ||
"image", | ||
"webpack", | ||
"loader", | ||
"img", | ||
"src", | ||
"img src" | ||
], | ||
@@ -25,0 +32,0 @@ "author": "Renan Bastos - <renanbastos.tec@gmail.com>", |
@@ -0,0 +0,0 @@ # image-to-base64 |
const image2base64 = require('./../'); | ||
const assert = require('assert'); | ||
const pt = require('path') | ||
image2base64('http://bit.ly/2hfduaO') | ||
.then( | ||
a => console.log(a) | ||
) | ||
.catch( | ||
x => console.log(x) | ||
); | ||
let url = "http://jaystack.com/wp-content/uploads/2015/12/nodejs-logo-e1497443346889.png"; | ||
let path = pt.resolve("test/nodejs.png"); | ||
describe("must to be resolved the promise", function(){ | ||
it('get image of the url and convert to base64', function(){ | ||
image2base64(url) | ||
.then( | ||
data => assert(data.match(/^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{0,2}==)$/gim)) | ||
) | ||
}); | ||
it('get image of the path and convert to base64', function(){ | ||
image2base64(path) | ||
.then( | ||
data => assert(data.match(/^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{0,2}==)$/gim)) | ||
) | ||
}) | ||
}); |
Sorry, the diff of this file is not supported yet
22819
7
58