Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
align-yaml
Advanced tools
Readme
Format, prettify, align, whatever you want to call it. This does that to YAML. Great for making long config files more readable!
Reformats this:
one: two
three: four
seventeen: five
to this:
one: two
three: four
seventeen: five
Install globally with npm:
npm i -g align-yaml
From the command line, use:
align [source file] [destination] [padding]
All arguments are optional
source
: the source file. first argument or -s
|--src
destination
: the destination file path. second argument or -d
|--dest
padding
: the amount of padding to add next to each line. third argument or -p
|--pad
Also:
.yml
or .yaml
files in the current working directory and format them.Glob patterns may also be used:
align **/*.yml
By default, all values are formatted to be aligned to the longest key with one space of padding. e.g.
one: two
three: four
seventeen: five
To add extra padding, just do something like align foo.yml -p 10
, to get:
one: two
three: four
seventeen: five
There isn't much of an API, just do:
var align = require('align-yaml');
Then pass a string to align(str)
. This is important! Read in the YAML as a string, DON'T PARSE IT.
Just do this, and you'll be fine:
var fs = require('fs');
var str = fs.readFileSync('foo.yml', 'utf8');
align(str, padding);
See the tests for a basic example.
Jon Schlinkert
Copyright (c) 2014 Jon Schlinkert, contributors.
Released under the MIT license
This file was generated by verb-cli on April 13, 2014.
FAQs
Format, prettify, align, whatever you want to call it. This does that to YAML. Great for making long config files more readable!
The npm package align-yaml receives a total of 97 weekly downloads. As such, align-yaml popularity was classified as not popular.
We found that align-yaml 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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.