
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.
@unic/estatico-utils
Advanced tools
Utilities for logging etc.
$ npm install --save-dev @unic/estatico-utils
const parseArgs = require('minimist');
const { Logger } = require('@unic/estatico-utils');
const env = parseArgs(process.argv.slice(2));
// Create instance of logger for specific plugin
const logger = new Logger('estatico-bla');
// Log info
logger.info('Something is happening');
// Log debug info, only logged if "-LLLL" is set
logger.debug('Something is happening', /* Additional log info */);
// Log error, will exit process unless env.dev is true
logger.error(new Error('Something went wrong'), env.dev);
const { Plugin } = require('@unic/estatico-utils');
// Set up details, schema and task
// …
module.exports = (options, env = {}) => new Plugin({
defaults,
schema,
options,
task,
env,
});
Compares files resolved from fileGlob
with current files in results/
directory.
const test = require('ava');
const utils = require('@unic/estatico-utils').test;
test.cb('default', (t) => {
task(defaults)().on('end', () => utils.compareFiles(t, path.join(__dirname, 'expected/default/*')));
});
Join everything sinon.spy
captured into string, strip ANSI characters and line-breaks.
const test = require('ava');
const sinon = require('sinon');
const utils = require('@unic/estatico-utils').test;
test.cb('error', (t) => {
const spy = sinon.spy(console, 'log');
task(defaults)().on('end', () => {
spy.restore();
const log = utils.stripLogs(spy);
t.regex(log, /test\/fixtures\/error.hbs Parse error on line 2/);
t.end();
});
});
Serve unchanged files from in-memory cache.
const { readFileSyncCached } = require('@unic/estatico-utils');
// First read will go to file system
console.log(readFileSyncCached('/path/to/my/file.ext'));
// Second request will be served from cache unless the file has changed in the meantime
// fs.statSync('/path/to/my/file.ext').mtime.getTime() is used as reference
console.log(readFileSyncCached('/path/to/my/file.ext'));
Apache 2.0.
FAQs
Utilities for logging etc.
We found that @unic/estatico-utils demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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.