1.2.2 • Published 8 years ago

json-to-pretty-yaml v1.2.2

Weekly downloads
661,614
License
Apache-2.0
Repository
github
Last release
8 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

extract-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-1986swagger-doc-gen-clitfxjsvarkes-app-connector-clientvarkes-openapi-mockvmsnapkanstructorinsomnia-plugin-swagerize-responsejust-chartkalpainanisgswaggerhexo-theme-wanghuhana-clihavas-api-documentorinomnisluren-swaggerlndbosslucid-dreamkuntur-testmedmarkmdwave@varkes/openapi-mock@varkes/app-connector-client@varkes/configuration@tuyau/openapi@tmcw/graphql-codegen-cli@thingweb/async-api-converter@tibco-software/cli-plugin-tcam@tonyfromundefined/graphql-codegen-cli@thing-description-playground/td_to_asyncapi@thing-description-playground/td_to_openapi@thingweb/open-api-converter@uttacoin/upl-token-swap@vnay92/adonis-autoswagger@yvu/driangelscripts-k8s-deploymentsangelscripts-k8s-development@zlog360/docker-composeaf-tools-tsadonis-autoswaggerapi-service-gen@graphql-codegen/cli@halfserious/yadutypeagentzbl-cliwebql-codegen-clitruecallerjs@orca-so/spl-token-swapms-startmq-microservicesmetamorphismmmfx-lambda-cliottermatoroutdocsandkitsamp-cliqest-node-utilsserverless-modularnext-monaco-editornoneapulen-adonis-autoswaggerpumapisolcial-spl-token-swap-testslack-emoji-exportgraphql-code-generatorgraphql-codegen-cli-nuxt@onlang-org/onst@openinc/node-red-contrib-openanalytics@openinc/node-red-contrib-openware@patrick-sung/contentful-hugo@gluestack/helpers@instant.dev/api@freshworks/crayons-icon@ikonintegration/openapi-serverless@fevo-tech/graphql-codegen-cli@plastichub/lib-content@plastichub/osr-discourse@plastichub/osr-i18n@plastichub/content@plastichub/osrl@outloud/adonis-autoswagger@pisanix/brainstormgenerator-woosung-devfunctionscript@stepfinance/step-swapegg-router-swagger-api-generatoregg-openapi-oas3enapso-swaggerfigma-tokens-cli
1.2.2

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.0

8 years ago