
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
stream-spigot
Advanced tools
A readable stream generator, useful for testing or converting simple functions into Readable streams.
A generator for (streams2) Readable streams, useful for testing or converting simple lazy functions into Readable streams, or just creating Readable streams without all the boilerplate.
var spigot = require("stream-spigot")
spigot.array(["ABCDEFG"]).pipe(process.stdout)
// ABCDEFG
spigot.array(["ABC", "DEF", "G"]).pipe(process.stdout)
// same as: (short form)
spigot(["ABC", "DEF", "G"]).pipe(process.stdout)
// ABCDEFG
// Create a stream out of a synchronous generator:
var count = 0
function gen() {
if (count++ < 5) {
return {val: count}
}
}
spigot.sync({objectMode: true}, gen).pipe(...)
/*
{val: 1}
{val: 2}
{val: 3}
{val: 4}
{val: 5}
*/
// Create a more traditional Readable stream:
var source = spigot({objectMode: true}, function () {
var self = this
iterator.next(function (err, value) {
if (err) return self.emit("error", err)
self.push(value)
})
})
source.pipe(...)
Create a Readable stream instance with the specified _read method. Your _read method should follow the normal stream.Readable _read syntax. (I.e. it should call this.push(chunk)
)
Create a Readable stream instance that will emit each member of the specified array until it is consumed. Creates a copy of the given array and consumes that -- if this will cause memory issues, consider implementing your own _read function to consume your array.
Same as the above except provides a constructor for your Readable class. You can then create instances by using either var source = new Spigot()
or var source = Spigot()
.
Same as the above except provides a constructor for your Readable class. You can then create instances by using either var source = new Spigot()
or var source = Spigot()
.
A manual version of the above to specify an array.
Create a readable instance providing a synchronous generator function. It will internally wrap your synchronous function as an async function.
Accepts standard readable-stream options.
MIT
FAQs
A readable stream generator, useful for testing or converting simple functions into Readable streams.
We found that stream-spigot 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
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.