Socket
Socket
Sign inDemoInstall

komatsu

Package Overview
Dependencies
10
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.2.3 to 1.2.4

.vscode/settings.json

5

index.js

@@ -52,3 +52,6 @@ const logUpdate = require('./log-update')

if (data.status && previous.status !== data.status) {
if (
(data.status && previous.status !== data.status) ||
previous.message.length > data.message.length
) {
logUpdate.clear()

@@ -55,0 +58,0 @@ }

9

log-update.js

@@ -5,2 +5,3 @@ // originally https://github.com/sindresorhus/log-update/

const cliCursor = require('cli-cursor')
const stripAnsi = require('@quarterto/strip-ansi')

@@ -56,6 +57,10 @@ const moveLines = count => {

const width = getWidth(stream)
prevLineCount = out
prevLineCount = stripAnsi(out)
.split('\n')
.map(line => 1 + Math.floor(line.length / width))
.map(line => Math.floor(line.length / width) + 1)
.reduce((a, b) => a + b)
// stream.write(prevLineCount.toString())
// console.log(out, `\n------ ${prevLineCount}`)
}

@@ -62,0 +67,0 @@

{
"name": "komatsu",
"version": "1.2.3",
"version": "1.2.4",
"description": "",

@@ -47,2 +47,3 @@ "main": "index.js",

"dependencies": {
"@quarterto/strip-ansi": "^1.1.0",
"ansi-colors": "^3.2.4",

@@ -49,0 +50,0 @@ "ansi-escapes": "^4.2.0",

@@ -5,7 +5,18 @@ const Komatsu = require('./')

Array.from({ length: 50 }, (_, i) => {
logger.log(i, { message: `stress test ${i}` })
logger.log(i, {
message: `stress test ${i} ${'a'.repeat(Math.ceil(100 * Math.random()))}`,
})
setTimeout(
() => logger.log(i, { status: 'done', message: `stress test ${i}` }),
() =>
logger.log(i, {
message: `stress test ${i} ${'a'.repeat(
Math.ceil(100 * Math.random()),
)}`,
}),
Math.random() * 5000,
)
setTimeout(
() => logger.log(i, { status: 'done', message: `stress test ${i}` }),
Math.random() * 5000 + 5000,
)
})
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc