
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
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 configuration 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 configuration 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 183 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.