Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
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
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.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.