
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
@koerber/yaml
Advanced tools
This simply wraps the js-yaml
package providing a parse(...)
convenience
method to parse files synchronously, and adding a couple of useful tags.
Very simply:
const { parse } = require('@koerber/yaml')
let parsed = parse('my_file.yml')
An optional second argument to the parse(...)
function allows to specify
the base schema for parsing (defaulting to DEFAULT_SAFE_SCHEMA)
.
The module also exposes dump(...)
as an alias to js-yaml
's safeDump(...)
.
!include
tagThe !include
tag will include another YAML file in the current one. For example:
object:
<<: !include other.yml
Given the contents of other.yml
as:
foo: bar
And noting the use of the <<:
merging tag in this example, the resulting
parsed JSON will be:
"object" {
"foo": "bar"
}
The !include
tag can be used also in included documents, and will resolve
file names relative to the real path of the document where the tag is
specified (in other words, symlinks are followed).
!merge
tagThe !merge
tag merges arrays of arrays into one single array. For example:
array: !merge
-
- one
- two
-
- three
- four
- five
-
- six
- seven
Will be parsed as the following JSON:
{
"array": [
"one",
"two",
"three",
"four",
"five",
"six",
"seven"
]
}
This is quite useful when used with references where a file like the following:
base: &base
- a
- b
merged: !merge
- *base
- c
Will be parsed as the following JSON:
{
"base": [ "a", "b" ],
"merged": [ "a", "b", "c" ]
}
Ultimately, this can also be used in conjunction with !include
whereas:
!merge
- !include other.yml
- baz
Given the following contents for other.yml
:
- foo
- bar
Will be parsed as the following JSON:
[ "foo", "bar", "baz" ]
!join
tagThe !join
tag joins array members into a string. For example:
joined: !join
- One
- Two
- Three
Will be parsed as the following JSON:
{ "joined": "OneTwoThree" }
The same output can be expected for the following YAML syntax:
joined: !join [ One, Two, Three ]
This work is licensed under the MIT License Agreement
FAQs
Simple extension to JS-YAML
The npm package @koerber/yaml receives a total of 0 weekly downloads. As such, @koerber/yaml popularity was classified as not popular.
We found that @koerber/yaml demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.