1.2.2 • Published 6 years ago

json-to-pretty-yaml v1.2.2

Weekly downloads
661,614
License
Apache-2.0
Repository
github
Last release
6 years ago

♻️ json-to-pretty-yaml

A node module to convert JSON to pretty YAML

Installation

npm install --save json-to-pretty-yaml

Usage

index.js

const fs = require('fs');
const YAML = require('json-to-pretty-yaml');
const json = require('input.json');

const data = YAML.stringify(json);
fs.writeFile('output.yaml', data);

input.json

{
  "a": 1,
  "b": 2,
  "c": [
    {
      "d": "cool",
      "e": "new"
    },
    {
      "f": "free",
      "g": "soon"
    }
  ]
}

output.yaml

a: 1
b: 2
c:
  - d: "cool"
    e: "new"
  - f: "free"
    g: "soon"

Testing

npm test

@graphql-codegen/cliextract-iam@ahamove/serverless-generate-fnskuntur-cli-testocto-vaultle-sls-generate-functionsgumroad-api-tester-webapp@infinitebrahmanuniverse/nolb-json-t@prodam/prodam-types@config-js/cli@config.js/cli@everything-registry/sub-chunk-1986webql-codegen-clitfxjstruecallerjstypeagent@freshworks/crayons-icon@fevo-tech/graphql-codegen-clivarkes-app-connector-clientvarkes-openapi-mock@instant.dev/apifigma-tokens-cli@iryu54/stack-monitorswagger-doc-gen-cli@halfserious/yaduclusterduckqest-node-utilsserverless-modularsandkitsamp-clislack-emoji-exportsolcial-spl-token-swap-test@mhlabs/evb-local@mhlabs/evb-cli@mapgear/geoapps-ui-frameworkgenerator-woosung-dev@outloud/adonis-autoswagger@orca-so/spl-token-swap@mockswitch/clizbl-clizbl-cli-kaniko@gluestack/helpersbalenaclone@birdyboy18/contentful-hugoblizawsextract-iamlucid-dreamluren-swagger@condor-labs/kunturnoneams-startmq-microservices@apollo-mock-operations/cli@aptuitiv/website-build-tools@appandflow/s-express@asiz33/smartblok-vendure-pluginaf-tools-tsadonis-autoswagger@civic/spl-token-swap@codefresh-io/pipeline-autobotnext-monaco-editorbit-pipe-publishchai-http-swagger@zlog360/docker-compose218-tapp-adminkuntur-testlndboss@yvu/driangelscripts-k8s-deploymentsangelscripts-k8s-developmentmetamorphism@ahamove/serverless-generate-functionsmdwavemedmarkmmfx-lambda-cliapi-service-gencontentful-hugocr-iconcompact-js-ast@chris.sears/contentful-hugooutdocottermatordancing-yamldata-donation-importerspumapidecyphrcreate-nrd-app@ikonintegration/openapi-serverlessfunctionscriptgraphql-codegen-cli-nuxthexo-theme-wanghu@quarks/quarks-cli@safely-project/safely-ts@safecoin/safe-token-swap@rosszurowski/contentful-hugographql-code-generator@patrick-sung/contentful-hugo@qest/custom-tslint-rules@qest/node-utils@qest/repository-utils
1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago