
Research
Malicious fezbox npm Package Steals Browser Passwords from Cookies via Innovative QR Code Steganographic Technique
A malicious package uses a QR code as steganography in an innovative technique.
babel-plugin-paths
Advanced tools
Babel plugin that returns an object containing paths like __dirname and __filename as static values
Babel macro that allows you to "import" the location of the source-file.
The supported paths you can import:
name | example |
---|---|
npmRoot | /Users/you/project |
gitRoot | /Users/you/project |
wd | /Users/you/project |
fileAbsolute | /Users/you/project/src/input.js |
file | input.js |
extention | .js |
filename | input |
baseAbsolute | /Users/you/project/src/ |
base | /src/ |
The default import is equal to base
.
Source file input.js
:
import base, { filename } from 'babel-plugin-module-paths/paths.macro';
console.log(base, filename);
alert(filename, base);
function usePathsForSomething() {
return [filename, base];
};
Output:
console.log("/src/", "input");
alert("input", "/src/");
function usePathsForSomething() {
return ["input", "/src/"];
};
Install:
yarn add babel-plugin-module-paths
If you don't have babel-macros already you must also install that:
yarn add babel-plugin-macros
Ensure you have babel-plugin-macros
in your babel config (.babelrc
).
{
"plugins": ["macros"]
}
FAQs
Babel plugin that returns an object containing paths like __dirname and __filename as static values
We found that babel-plugin-paths 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
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.
Application Security
/Research
/Security News
Socket detected multiple compromised CrowdStrike npm packages, continuing the "Shai-Hulud" supply chain attack that has now impacted nearly 500 packages.