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

@contrast/library-analysis

Package Overview
Dependencies
Maintainers
0
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@contrast/library-analysis - npm Package Compare versions

Comparing version 1.20.3 to 1.21.0

16

lib/install/library-usage/index.js

@@ -25,2 +25,4 @@ /*

const MAX_TS_OBSERVATIONS_PER_POST = 100;
module.exports = function init(core) {

@@ -89,4 +91,6 @@ const { config, logger, messages } = core;

libraryUsage.report = function () {
const eventsToSend = [];
let count = 0;
for (const info of bufferedEvents) {
messages.emit(Event.LIBRARY_USAGE, {
eventsToSend.push({
id: info.hash,

@@ -96,3 +100,13 @@ names: Array.from(info.names),

bufferedEvents.delete(info);
if (++count >= MAX_TS_OBSERVATIONS_PER_POST) {
messages.emit(Event.LIBRARY_USAGE, eventsToSend);
eventsToSend.length = 0;
count = 0;
}
}
// any leftovers?
if (eventsToSend.length) {
messages.emit(Event.LIBRARY_USAGE, eventsToSend);
}
};

@@ -99,0 +113,0 @@

4

package.json
{
"name": "@contrast/library-analysis",
"version": "1.20.3",
"version": "1.21.0",
"description": "Handles library reporting and library usage analysis",

@@ -21,3 +21,3 @@ "license": "SEE LICENSE IN LICENSE",

"@contrast/code-events": "^3.0.0",
"@contrast/common": "1.21.3",
"@contrast/common": "1.22.0",
"@contrast/find-package-json": "^1.1.0",

@@ -24,0 +24,0 @@ "semver": "^7.3.8"

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