
Research
/Security News
Toptal’s GitHub Organization Hijacked: 10 Malicious Packages Published
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
github.com/tmc/bubbweb
BubbWeb is a library for running Bubbletea terminal user interfaces in WebAssembly.
Check out the live demo to see BubbWeb in action.
import (
tea "github.com/charmbracelet/bubbletea"
"github.com/tmc/bubbweb"
)
func main() {
// Create your BubbleTea model as usual
model := yourModel()
// Use bubbweb to run the program in WebAssembly
prog := bubbweb.NewProgram(model, tea.WithAltScreen())
if _, err := prog.Run(); err != nil {
// Handle error
}
}
# Build everything with go generate
go generate
# For local testing with auto-reload
cd example
go run github.com/tmc/serve@latest # or any other HTTP server
Then open http://localhost:8080 in your browser.
See the example
directory for a complete example including:
This project can be easily deployed on GitHub Pages:
example
directory to your GitHub repositoryexample
directory/
or /example
depending on your repository structureYour Bubbletea WebAssembly application will be available at https://[username].github.io/[repository]/example
BubbWeb handles several challenges of running Bubbletea in WebAssembly:
bubbletea_write
: Sends input from JavaScript to the Go programbubbletea_read
: Reads output from the Go programbubbletea_resize
: Sends terminal resize events to the Go programbubbletea_mouse
: Sends mouse events to the Go programMouse events are translated from browser events to BubbleTea's mouse event system:
case tea.MouseMsg:
switch msg.Type {
case tea.MousePress:
// Handle mouse press at (msg.X, msg.Y)
case tea.MouseRelease:
// Handle mouse release
case tea.MouseMotion:
// Handle mouse movement
case tea.MouseWheelUp, tea.MouseWheelDown:
// Handle scrolling
}
}
The coordinates are automatically converted from pixel coordinates to terminal cell coordinates.
MIT
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.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
Research
/Security News
Socket researchers investigate 4 malicious npm and PyPI packages with 56,000+ downloads that install surveillance malware.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.