
Security News
npm ‘is’ Package Hijacked in Expanding Supply Chain Attack
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
git.sr.ht/~liliace/pogs
A thread-safe go library for displaying multiple progress bars in unix terminals.
Progress bars typically clear and redraw the line as they update. Using a progress bar library not designed to display multiple progress bars to do so would cause each progress bar to rewrite each other.
The pogs library supports displaying multiple progress bars by moving and keeping track of the cursor position.
Additionally, the pogs library separates the method for creating a progress bar
into NewBar
and Start
to support use cases where
the jobs of the progress bar may complete before we know the number of the jobs
(see example below).
The pogs library depends on golang.org/x/sys
,
which hangs forever if you have GOPROXY=direct
in your environment.
Install with the cache proxy instead:
GOPROXY="" go get -u git.sr.ht/~liliace/pogs
In this example, we don't know the size of each progress bar
until after we have finished each inner loop.
We are still able to advance the progress bar data with bars.Add
before displaying it with bars.Start
.
bars, err := pogs.NewBars()
if err != nil {
log.Fatal(err)
}
for _ = range 5 {
id, _ := bars.NewBar()
size := 0
// consider root a pre-defined node of some linked-list
for curr := root; curr != nil; curr = curr.Next {
bars.Add(id)
size += 1
}
bars.Start(id, size)
}
bars.Done()
The id returned by bars.NewBar
is the id-th bar created,
so the loop above can be simplified to:
for i = range 5 {
bars.NewBar()
size := 0
for curr := root; curr != nil; curr = curr.Next {
bars.Add(i)
size += 1
}
bars.Start(i, size)
}
FAQs
Unknown package
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.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
Security News
A critical flaw in the popular npm form-data package could allow HTTP parameter pollution, affecting millions of projects until patched versions are adopted.
Security News
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.