1.2.2 • Published 7 years ago

json-to-pretty-yaml v1.2.2

Weekly downloads
661,614
License
Apache-2.0
Repository
github
Last release
7 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-mockvmsnap@codefresh-io/pipeline-autobot@condor-labs/kuntur@rosszurowski/contentful-hugokanstructorinsomnia-plugin-swagerize-responsejust-chartkalpatypeagent@apollo-mock-operations/cli@appandflow/s-express@aptuitiv/website-build-tools@asiz33/smartblok-vendure-plugin@ahamove/serverless-generate-functions@birdyboy18/contentful-hugo@civic/spl-token-swap@chris.sears/contentful-hugo218-tapp-adminzbl-cliwebql-codegen-clitruecallerjs@halfserious/yadu@fevo-tech/graphql-codegen-cli@graphql-codegen/cli@freshworks/crayons-icon@gluestack/helpers@instant.dev/api@iryu54/stack-monitor@mhlabs/evb-cli@mhlabs/evb-local@mapgear/geoapps-ui-framework@mockswitch/cli@jsonresume/jsonresume-to-rendercv@ikonintegration/openapi-serverless@moontai0724/openapi@qest/custom-tslint-rules@qest/node-utils@qest/repository-utils@qest/swagger-utils@safecoin/safe-token-swap@safely-project/safely-ts@quarks/quarks-cli@sap/ams@openinc/node-red-contrib-openanalytics@openinc/node-red-contrib-openware@onlang-org/onst@patrick-sung/contentful-hugo@plastichub/content@plastichub/lib-content@plastichub/osrl@plastichub/osr-discourse@plastichub/osr-i18n@pisanix/brainstorm@orca-so/spl-token-swap@outloud/adonis-autoswagger@remie/acdeploy@robbyawaldi/json2schema@robbyawaldi/mockup-generatorms-startmq-microservicesmetamorphismmmfx-lambda-cliottermatoroutdocsandkitsamp-cliqest-node-utilsserverless-modularnext-monaco-editornoneapulen-adonis-autoswaggerpumapisolcial-spl-token-swap-testslack-emoji-exportgraphql-code-generatorgraphql-codegen-cli-nuxtinanisgswaggerhexo-theme-wanghuhana-clihavas-api-documentorinomnisluren-swaggerlndbosslucid-dream
1.2.2

7 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago