initials-avatar-generator
Advanced tools
Comparing version 1.3.0 to 1.4.0
@@ -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 |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 2 instances in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
17
2353
57
1
3
277770