
Company News
/Security News
Socket Selected for OpenAI's Cybersecurity Grant Program
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.
progress-str
Advanced tools
Create a string based progress bar.
import { progressBar } from 'progress-str'
const bar = progressBar()
bar.render(0.5) // [-----------|-----------] 50%
// Also support multiple values
bar.render(0.25, 0.5, 1) // [---|--|-----|] 25% 50% 100%
// If the value is unknown/not available, pass in undefined:
bar.render(0.5, undefined) // [---------|----------] 0.5 ---
progressBar({
bar: {
completedMarker: '-', // marker for completed section of the bar
incompleteMarker: '-' // marker for incomplete section of the bar
leftBracketMarker: '['
rightBracketMarker: ']'
},
length: 30, // total length of the result, including the text
textAlign: 'left', // align text relative to max possible text length of each entry.
textPosition: 'right', // 'left' | 'right' | 'none'
value: {
digits: 1 // number of fraction digits. 0 | 1 | 2.
// It defaults to different values depending on the max value.
max: 1, // Value that means 100%.
// It can be set to undefined, to indicate that value is not available.
// But the render value must also be undefined.
// If not it will throws MissingMaxValue.
marker: '|', // marker for the value
textStyle: 'percentage', // 'percentage' | 'number' | 'ratio'
textTransform(text: string): string, // transform the styled string, can use this to color the text
}
})
// To style multiple values differently.
progressBar({
...
value: [{ ... }, { ... }, ...]
})
FAQs
Create a progress string
The npm package progress-str receives a total of 4 weekly downloads. As such, progress-str popularity was classified as not popular.
We found that progress-str demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.