
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.
rename-pipeline
Advanced tools
Apply transforms to rename files.
Usage: rename-pipeline [source files] {OPTIONS}
Examples:
rename-pipeline ./src/*.js -t contenthash
rename-pipeline ./src/**/*.jpg -t gitshorthash -t [ cssimgrename -s ./src/**/*.css ]
Options:
-t, --transform Apply a transform to the file [required]
-d, --dryrun Print the result of the rename transforms to stdout, without
actually renaming the files
-h, --help Show this message
Passing arguments to transforms:
For -t, you can use subarg syntax to pass options to the
transforms as the second parameter. For example:
-t [ foo -x 3 -y ]
will call the `foo` transform with the following options:
{ x: 3, y: true }
$ npm install -g rename-pipeline
Globs can be used to denote source files:
$ rename-pipeline ./src/*.js -t contenthash
To perform multiple transforms on a set of files:
$ rename-pipeline ./src/*.js -t contenthash -t timestamp
To pass options to individual transforms, you can use subarg syntax:
$ rename-pipeline ./src/*.jpg -t gitshorthash -t [ cssimgrename -s ./src/*.css ]
var renamePipeline = require('rename-pipeline');
Initialise a new RenamePipeline
.
Set the files to be transformed as a glob.
Add a transform to the pipeline.
A transform can be either an object denoting which transform to use, plus any options:
r.transform({ name: 'contenthash' });
r.transform({ name: 'cssimgrename', options: { s: './src/*.css' } });
Or it can be a function that returns a transform stream:
r.transform(function(){
return through(function(chunk, enc, cb){
this.push('foo');
cb();
});
});
If true, the result of the rename transforms will be printed to stdout, but no actual renaming will occur.
Run the transform pipeline, executing the optional done callback when complete.
There are a few built-in transforms, but the intention is for these to become separate modules that aren't included in this repo.
Append a hash of the file contents:
/lib/normalise.js -> /lib/normalise.f93e7a76.js
The hash algorithm defaults to md5
. The hash encoding defaults to hex
. These can be changed via the command-line:
$ rename-pipeline ./src/*.js -t [ contenthash -a sha1 -e hex ]
Or via the API:
r.transform({
name: 'contenthash',
options: {
algorithm: 'sha1',
encoding: 'hex'
}
});
Append the git short version hash of HEAD
:
/lib/normalise.js -> /lib/normalise.61949eb.js
Append the timestamp (uses moment and defaults to YYYYMMDD-HHmm
):
/lib/normalise.js -> /lib/normalise.20150126-1214.js
The date format can be changed via the command-line:
$ rename-pipeline ./src/*.js -t [ timestamp -f YYYY ]
Or via the API:
r.transform({
name: 'timestamp',
options: {
format: 'YYYY'
}
});
Rename images within css files, based on the current file's new basename.
For a file that is being renamed to pic.12345.jpg
, the following CSS:
body {
background: url("./pic.jpg");
color: green;
}
Will be transformed to:
body {
background: url("./pic.12345.jpg");
color: green;
}
$ npm test
FAQs
Apply transforms to rename files.
We found that rename-pipeline 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.