Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

yamlutil

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yamlutil

A command-line YAML editor that preserves comments and styling.

  • 0.1.3
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

YAWN YAML CLI

npm Build Status

A command-line YAML editor that preserves comments and styling.

Based on the Node.js package YAWN YAML.

Installation

npm install yawn-yaml-cli [--global]

Usage

yawn [command] # If installed with --global
$(npm bin)/yawn [command] # If installed locally

See yawn --help for all commands and options, including output format and error handling. Major commands are listed below.

yawn get

yawn get <file> <path>

Gets the specified entry inside the given YAML file.

Uses lodash.get() syntax for the path.

yawn set

yawn set <file> <path> <value>

Sets an entry in the given YAML file. Uses lodash.set() syntax for the path.

If adding to an existing array, any value higher than the last index will push to the last array index, instead of inserting null entries:

users:
  - alice
  - bob

# Run `yawn set users.yaml users[10] jim`

users:
  - alice
  - bob
  - jim # Inserted at index 3, not 10.

yawn push

yawn push <file> <path> <value>

Pushes the given value onto the end of an array, creating the array if needed.

# users.yaml
users:
  - alice
  - bob
yawn push users.yaml users "jim"

rm -rf users.yaml; yawn push users.yaml users "alice"
# will create "users.yaml", a "users" array, and will push "alice" onto the new array

FAQs

Package last updated on 14 Jul 2019

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc