
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.
yaml-js-loader
Advanced tools
Tells webpack how to load YAML files.
Open up your terminal and type the following
$ npm install --save-dev yaml-js-loader
The usage is quite easy.
Create a yaml file.
name: Izuku Midoriya
quirk: One for all
friends:
- Todoroki
- Lida
- Ochacho
- Bakugo
import the YAML file in your javascript file.
import config from './config.yml';
console.log(config);
// output -> {
// url: "",
// json: {
// name: "Izuku Midoriya",
// . quirk: "One for all",
// friends: [
// "Todoroki",
// "Lida",
// "Ochacho",
// "Bakugo"
// ]
// .},
// text:"name: Izuku Midoriya\nquirk: One for all\nfriends:\n - Todoroki\n - Lida\n - Ochacho\n - Bakugo"\n
//}
Add the following conifguration to webpack config file.
...
{
test: /\.yml$/,
loader: 'yaml-js-loader'
}
...
Using with file loader provides a live URL to where the YAML file is served.
The file can be accessed by visiting [base_url][webpack_public_path][url]
for example,
if,
then,
to access the file in the browser, you would need to visit: http://localhost:3005/public/static/config.d23e812af.yml
Create a yaml file.
name: Izuku Midoriya
quirk: One for all
friends:
- Todoroki
- Lida
- Ochacho
- Bakugo
import the YAML file in your javascript file. Now, the url property should have a value.
import config from './config.yml';
console.log(config);
// output -> {
// url: "/static/[name].[hash:8].[ext]",
// json: {
// name: "Izuku Midoriya",
// . quirk: "One for all",
// friends: [
// "Todoroki",
// "Lida",
// "Ochacho",
// "Bakugo"
// ]
// .},
// text:"name: Izuku Midoriya\nquirk: One for all\nfriends:\n - Todoroki\n - Lida\n - Ochacho\n - Bakugo"\n
//}
Add the following conifguration to webpack config file.
module.exports = {
...
{
test: /\.(yml|yaml)$/,
use: [
{ loader: 'yaml-js-loader' },
{
loader: 'file-loader',
options: {
name: 'static/[name].[hash:8].[ext]'
}
}
]
}
...
}
FAQs
A YAML file loader for webpack
The npm package yaml-js-loader receives a total of 206 weekly downloads. As such, yaml-js-loader popularity was classified as not popular.
We found that yaml-js-loader 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.