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

fast-average-color-node

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fast-average-color-node - npm Package Compare versions

Comparing version 0.1.0 to 1.0.0

2

dist/index.js

@@ -17,4 +17,4 @@ "use strict";

const imageData = context.getImageData(0, 0, width, height);
return fac.getColorFromArray4(imageData.data, options);
return fac.prepareResult(fac.getColorFromArray4(imageData.data, options));
}
exports.getAverageColor = getAverageColor;
{
"name": "fast-average-color-node",
"version": "0.1.0",
"description": "A simple library that calculates the average color of images, videos and canvas in Node.js.",
"version": "1.0.0",
"description": "A simple library that calculates the average color of images in Node.js.",
"main": "dist/index.js",

@@ -14,3 +14,3 @@ "keywords": [

"canvas": "^2.6.1",
"fast-average-color": "^6.1.1"
"fast-average-color": "^6.2.0"
},

@@ -34,3 +34,4 @@ "files": [

"test": "jest",
"build": "tsc -p tsconfig.json"
"build": "tsc -p tsconfig.json",
"prepare": "npm run build"
},

@@ -37,0 +38,0 @@ "author": {

@@ -1,5 +0,5 @@

# Fast Average Color for Node.js
# [Fast Average Color](https://github.com/fast-average-color/fast-average-color/) for Node.js
[![NPM version](https://img.shields.io/npm/v/fast-average-color-node.svg)](https://www.npmjs.com/package/fast-average-color-node)
[![NPM Downloads](https://img.shields.io/npm/dm/fast-average-color-node.svg?style=flat)](https://www.npmjs.org/package/fast-average-color-node)
[![Dependency Status](https://img.shields.io/david/fast-average-color-node/fast-average-color-node.svg)](https://david-dm.org/fast-average-color-node/fast-average-color-node)
[![Dependency Status](https://img.shields.io/david/fast-average-color/fast-average-color-node.svg)](https://david-dm.org/fast-average-color/fast-average-color-node)

@@ -37,3 +37,3 @@ A simple library that calculates the average color of any images for Node.js.

/**
* @param {string | Buffer} filename, Buffer or data64 string
* @param {string | Buffer} [filename] filename, Buffer or data64 string
* @param {Object} [options]

@@ -72,1 +72,5 @@ * @param {number[]} [options.defaultColor=[0, 0, 0, 0]]

MIT License
## Links
- [fast-average-color](https://github.com/fast-average-color/fast-average-color/)

@@ -6,3 +6,3 @@ import { createCanvas, loadImage } from 'canvas';

export async function getAverageColor(filename: string | Buffer, options?: IFastAverageColorOptions): Promise<IFastAverageColorRgba> {
export async function getAverageColor(filename: string | Buffer, options?: IFastAverageColorOptions): Promise<IFastAverageColorResult> {
const image = await loadImage(filename);

@@ -17,3 +17,3 @@ const { width, height } = image;

return fac.getColorFromArray4(imageData.data, options);
return fac.prepareResult(fac.getColorFromArray4(imageData.data, options));
}
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