Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Module for editing YAML
The yaml editor can be initialized by passing the yaml (string) as a parameter to the require function.
let yamlEdit = require('yaml-edit')(myYamlText)
Alternatively, the editor can be initialized with the init(string text)
method
let yamlEdit = require('yaml-edit)();
yamlEdit.init(myYamlText);
Snippets can be added to the YAML with the insertChild(string target, object doc)
method. For example:
yamlEdit.init(myInitialYaml);
yamlEdit.insertChild('functions', {
hello: {
handler: 'index.handler'
}
})
Target can also be a deeper in the hierarchy, e.g.
yamlEdit.insertChild('functions.hello', {
events: [
{ foo : bar}
]
})
If the insert is successful, insertChild()
returns null
, otherwise (e.g. if the target location cannot be found),
it returns an Error
Existance of a key can be checked with the hasKey(string target)
method. Returns true if the key is found, false otherwise.
The resulting YAML can be returned using the dump()
method. E.g.
let output = yamlEdit.dump();
Please run module tests in a Node 4 environment prior to submitting PRs using
npm run test
Add tests for any additional cases you implement into test/yaml-edit.test.js
Licensed for users and contributors under MIT license. https://github.com/mpuittinen/yaml-edit/blob/master/LICENSE
FAQs
Library for editing yaml files
The npm package yaml-edit receives a total of 2,931 weekly downloads. As such, yaml-edit popularity was classified as popular.
We found that yaml-edit 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 uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.