
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.
rolling-file
Advanced tools
Write to a file until limits you define are reached, after which a new file is created to and written to until its limits are reached, and so on.
Write to a file until limits you've defined are reached, after which a new file is created and written to until its limits are reached, and so on. Writing is done using write streams.
npm install rolling-file
var rollingFile = require('rolling-file');
var f = rollingFile('./logs', { fileName: 'foo', byteLimit: '500 MB' });
f.write('Hello, World!');
...
f.end();
var rollingFile = require('rolling-file');
var f = rollingFile('./logs', { fileName: 'foo', interval: '1 day' });
f.write('Hello, World!');
...
f.end();
var rollingFile = require('rolling-file');
var f = rollingFile('./logs', { fileName: 'foo', byteLimit: '500 MB', interval: '1 day' });
f.write('Hello, World!');
...
f.end();
Parameters:
Returns: An object with properties for writing to the data stream:
The configuration parameter has the following options:
The naming of files is an automated process through which you have some control. You can provide a file name prefix and the file extension. A timestamp and an index are also added to the file name automatically.
The timestamp is formatted as YYYY-MM-DD-HHMMSS and it will contain the time stamp for when it was first written to if no interval is provided. If an interval is provided then the time stamp will reflect that time that lines up with that interval.
The index is added after the timestamp and is used to split multiple files that fit the same timestamp.
See below for some configurations and their potential output:
config = { fileName: 'foo', fileExtension: 'bar', byteLimit: '2 GB' };
possible_outputs = [
'foo.2000-01-01-102345.0.bar',
'foo.2000-01-01-102345.1.bar'
'foo.2000-01-01-180200.0.bar'
]
config = { fileName: '', interval: '1 day', byteLimit: '500 MB' };
possible_outputs = [
'2000-01-01-000000.0.log',
'2000-01-01-000000.1.log',
'2000-01-02-000000.0.log',
'2000-01-03-000000.0.log'
];
FAQs
Write to a file until limits you define are reached, after which a new file is created to and written to until its limits are reached, and so on.
We found that rolling-file 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.