Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Recursively walks a directory and emits filenames. Supports additional stat and read events (if you want them).
Recursively walks a directory and emits filenames. Supports additional stat and read events (if you want them).
I keep writing and re-writing this code in one form or another for most of my projects. I thought it might be useful to some of you. There are a few similar packages on npm already but none seem to have either the narrow focus I wanted or they use straight fs
calls which can be harsh when EMFILE happens.
Walk a directory named content
and console.log
the filenames:
powerwalk('./content')
.on('file', function(filename){
console.log(filename)
})
Or pipe the filenames through a stream:
var through = require('through')
, stream = through(write, end)
powerwalk('./content').pipe(stream)
Performs an async walk, returns an event emitter that will execute file calls and emit events appropriately.
var walker = powerwalk('my-directory')
function(error){ }
Emitted when an error happens
function(filename){ }
Everytime a file is found this is emitted with the absolute path to the file as filename.
function(file){ }
If there is a listener for the stat
event an fs.stat
call will be made and emit this event with a file object
function(file){ }
If there is a listener for the read
event an fs.readFile
call will be made and emit this event with a file object.
function(end){ }
Emitted when the walk is over.
Objects emitted from stat
and and read
events will have 3 properties:
filename
- the absolute pathname for the filestats
- the stats result for the filedata
- the contents of the fileFAQs
Recursively walks a directory and emits filenames. Supports additional stat and read events (if you want them).
The npm package powerwalk receives a total of 7 weekly downloads. As such, powerwalk popularity was classified as not popular.
We found that powerwalk 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
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.