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@rosszurowski/contentful-hugokanstructorinsomnia-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@civic/spl-token-swap@chris.sears/contentful-hugo218-tapp-admin@graphql-codegen/cli@halfserious/yadu@ahamove/serverless-generate-functions@codefresh-io/pipeline-autobot@condor-labs/kunturtypeagent@birdyboy18/contentful-hugozbl-cliwebql-codegen-clitruecallerjs@mockswitch/cli@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@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-editornonea
1.2.2

7 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago