@yaml-tools/get-node-path
v1.0.5
Published
A YAML utility that converts an array of nodes to a simple path to node represented via an array of string or numbers.
Downloads
8
Readme
@yaml-tools/get-node-path
A utility for the yaml package that converts an array
of nodes to a simple path to node represented via an array of strings or numbers.
Would most be commonly used in YAML.visit()
.
import getNodePath from `@yaml-tools/get-node-path`;
YAML.visit(yaml, (key, node, path) => {
console.log(getNodePath(path));
});
// ['this', 'is', 'node', 'path']