Socket
Socket
Sign inDemoInstall

dependency-cruiser

Package Overview
Dependencies
Maintainers
1
Versions
533
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dependency-cruiser - npm Package Compare versions

Comparing version 1.15.1 to 1.15.2

2

package.json
{
"name": "dependency-cruiser",
"version": "1.15.1",
"version": "1.15.2",
"description": "Validate and visualize dependencies. With your rules. JavaScript, TypeScript, CoffeeScript. ES6, CommonJS, AMD.",

@@ -5,0 +5,0 @@ "bin": {

@@ -11,2 +11,6 @@ "use strict";

/* OS pipe buffer size in bytes - which is what ulimit -a tells me on OSX */
const PIPE_BUFFER_SIZE = 512;
function writeToFile(pOutputTo, pDependencyString) {

@@ -24,5 +28,28 @@ try {

/**
* Writes the string pString to stdout in chunks of pBufferSize size.
*
* When writing to a pipe, it's possible that pipe's buffer is full.
* To prevent this problem from happening we should take the value at which
* the OS guarantees atomic writes to pipes - which on my OSX machine is
* 512 bytes. That seems pretty low (I've seen reports of 4k on the internet)
* so it looks like a safe limit.
*
* @param {string} pString The string to write
* @param {number} pBufferSize The size of the buffer to use.
* @returns {void} nothing
*/
function writeToStdOut(pString, pBufferSize) {
const lNumberOfChunks = Math.ceil(pString.length / pBufferSize);
let i = 0;
for (i = 0; i < lNumberOfChunks; i++) {
process.stdout.write(pString.substr(i * pBufferSize, pBufferSize));
}
}
function write(pOutputTo, pContent) {
if ("-" === pOutputTo) {
process.stdout.write(pContent);
writeToStdOut(pContent, PIPE_BUFFER_SIZE);
} else {

@@ -64,2 +91,2 @@ writeToFile(pOutputTo, pContent);

/* eslint no-process-exit: 0 */
/* eslint no-process-exit: 0 no-plusplus: 0*/
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