
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.
load-alias
Advanced tools
npm install load-alias
This module requires files via aliases
const LoadAlias = require('load-alias');
const loadConfig = {
public: 'public/',
css: '@public/css/',
img: '@public/img/',
favicon: '@img/favicon.ico',
db: 'db/',
dbModels: '@db/models/',
upload: 'upload/',
test: function (alias, replacement) {
return 'some/thing';
}
}
const alias = new LoadAlias(loadConfig); // or new loadAlias(rootPath, loadConfig)
let modelUser = alias.load('@dbModels/user.js');
let imgAvatarPath = alias.getPath('@img/avatar.png'); // => 'public/img/avatar.png'
let imgAvatarFullPath = alias.getFullPath('@img/avatar.png'); // => alias.rootPath + '/public/img/avatar.png'
let path = alias.require('path'); // gets nodejs path library
let something = alias.require('./relative/path/'); // doesn't merge with .rootPath
The default alias.rootPath
= process.cwd()
But you can change it: alias.rootPath = something
Loading file using a full path
Loading file using a relative path.
Getting the config
Config will be merged with the current
Getting the alias
Adding or updating the alias
Deleting the alias
Getting transformed path without .rootPath
Getting the full transformed path including .rootPath
FAQs
This module requires files via aliases
We found that load-alias 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.