
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
babel-plugin-inline-import-data-uri
Advanced tools
Babel plugin to make raw files importable as base64 encoded data URI strings.
Babel plugin to add the opportunity to use import
file content as DataURI.
// server.js
import logo from './logo.svg';
// Will print "data:image/svg+xml;base64,PD94bWwgdmVyc2lv...4KPC9zdmc+';"
console.log(logo);
Note: both cases are equivalent and will result in similar code after Babel transpile them. Check How it works section for details.
npm install babel-plugin-inline-import-data-uri --save-dev
Add a .babelrc
file and write:
{
"plugins": [
"inline-import-data-uri"
]
}
or pass the plugin with the plugins-flag on CLI
babel-node myfile.js --plugins inline-import-data-uri
By default, Babel-Inline-Import is compatible with the following file extensions:
If you want to enable different file extensions, you can define them in your .babelrc
file
{
"plugins": [
["babel-plugin-inline-import", {
"extensions": [
".html",
".jpg"
]
}]
]
}
It inserts the content of the imported file directly into the importing file, assigning it to a variable with the same identifier of the import statement, thus replacing the import statement and the file path by its resulting raw content (no parsing occurs).
Babel does not track dependency between imported and importing files after the transformation is made. Therefore, you need to change the importing file in order to see your changes in the imported file spread. To overcome this:
babel-node
or babel-register
, you can disable babel cache (BABEL_DISABLE_CACHE=1
).babel-loader
, you can use babel-inline-import-loader.Also make sure that your task runner is watching for changes in the imported file as well. You can see it working here.
This project is based on babel-plugin-inline-import.
FAQs
Babel plugin to make raw files importable as base64 encoded data URI strings.
We found that babel-plugin-inline-import-data-uri 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
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.