New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

image-to-base64

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

image-to-base64 - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

.npmignore

0

index.js

@@ -0,0 +0,0 @@ "use strict";

23

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc