Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

initials-avatar-generator

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

initials-avatar-generator - npm Package Compare versions

Comparing version 1.3.0 to 1.4.0

lib/configuration.js

2

lib/color.js

@@ -47,3 +47,3 @@ // inner color set

var random = function () {
return pickone(Traditional_colors_of_Japan)
return pickone(Traditional_colors_of_Japan);
};

@@ -50,0 +50,0 @@

@@ -13,18 +13,10 @@ var path = require('path')

function EnFont(size) {
var Bariol = function (size) {
Font.call(this, size);
this.file = base + "Bariol.otf";
}
util.inherits(EnFont, Font);
var Bariol = function (size) {
EnFont.call(this, size);
};
var Din = function (size) {
EnFont.call(this, size);
Font.call(this, size);
this.file = base + "DIN.otf";

@@ -34,12 +26,5 @@ };

util.inherits(Bariol, EnFont);
util.inherits(Din, EnFont);
var getfromtext = function (text, width) {
return new Din(width);
};
var get = function (f, width) {
if (f == null)
return null
if (typeof f != 'string')
return null;
switch (f.toUpperCase()) {

@@ -51,3 +36,3 @@ case 'BARIOL':

default:
return null;
return new Din(width);
}

@@ -59,2 +44,2 @@ };

exports.get = get;
exports.getfromtext = getfromtext;
{
"name": "initials-avatar-generator",
"version": "1.3.0",
"version": "1.4.0",
"description": "a random avatar generator base on node and node-imagemagick",

@@ -24,3 +24,3 @@ "main": "index.js",

"devDependencies": {
"gm": "^1.17.0",
"chai": "^3.0.0",
"gulp": "^3.8.11",

@@ -27,0 +27,0 @@ "mocha": "*"

@@ -17,16 +17,17 @@ # initials-avatar-generator

```
the first arguments is config
```javascript
var image = require('initials-avatar-generator').image
var fs = require('fs')
var AvatarGenerator = require('initials-avatar-generator').AvatarGenerator;
var option = {
width:100, //可选值 integer
color:eb002a, //rgb
font:kx //kx,lihei,bariol,din
}
//return a buffer
image(option,function(buffer){
fs.writeFile('file.png',buffer)
})
width: 100,
text: 'JL',
color: '#FF0000'
};
var avatarGenerator = new AvatarGenerator();
avatarGenerator.generate(option, function (image) {
image //image is ImageMagick object - you can do whatever you want with it!
.stream('png') // make a stream out of it
.pipe(res); //pipe it to output, or maybe a file?
});
```

@@ -33,0 +34,0 @@ ## LICENSE

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