
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
gpio-stream
Advanced tools
GPIO Stream allows you to pipe around inputs and outputs on the Raspberry Pi using the node.js stream API. Why is this a good thing? Node streams allow you to pipe output from one stream to the input of another stream, just like unix pipes. Streams make it easy to combine small chunks of code into complex systems with very little effort.
npm install gpio-stream
Let's say we want to view the state of the button from our SSH connection. Since stdout is a writable stream, we can pipe the output of the button directly to stdout.
var GpioStream = require('gpio-stream'),
button = GpioStream.readable(17);
// pipe the button presses to stdout
button.pipe(process.stdout);
Now let's try a simple example of how to pipe the output of a button to an LED.
var GpioStream = require('gpio-stream'),
button = GpioStream.readable(17),
led = GpioStream.writable(18);
// pipe the button presses to the LED
button.pipe(led);
What else can we do with this? How about streaming the button presses to a LED & to a web browser? Since the node.js HTTP server response is a writable stream, we can pipe the button presses to the LED, and then to the HTTP response object. Your browser can receive the presses on the fly using chunked transfer encoding. All of that with ~10 lines of code!
var GpioStream = require('gpio-stream'),
http = require('http'),
button = GpioStream.readable(17),
led = GpioStream.writable(18);
var stream = button.pipe(led);
http.createServer(function (req, res) {
res.setHeader('Content-Type', 'text/html');
res.write('<pre>logging button presses:\n');
stream.pipe(res);
}).listen(8080);
Copyright (c) 2014 Adafruit Industries. Licensed under the MIT license.
FAQs
Readable and Writable GPIO Streams for use with the Raspberry Pi
We found that gpio-stream 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.