Test cases / json

deft json convert

Change format: --to json|jsonl|yaml|toml|xml

1 run on real files, 7 tests on generated files, not shown. 0 failed.

Fixed cases

Generated files, compared with ground truth by tools other than deft.

a real package.jsonPassed

deft json convert express.json --to yaml -o out.yaml

Input

{
  "name": "express",
  "description": "Fast, unopinionated, minimalist web framework",
  "version": "5.3.0",
  "author": "TJ Holowaychuk <[email protected]>",
  "contributors": [
    "Aaron Heckmann <[email protected]>",
    "Ciaran Jessup <[email protected]>",
    "Douglas Christopher Wilson <[email protected]>",
    "Guillermo Rauch <[email protected]>",
    "Jonathan Ong <[email protected]>",
    "Roman Shtylman <[email protected]>",
    "Young Jae Sim <[email protected]>"
  ],
  "license": "MIT",
  "repository": "expressjs/express",
  "homepage": "https://expressjs.com/",
  "funding": {
    "type": "opencollective",
    "url": "https://opencollective.com/express"
  },
  "keywords": [
    "express",
    "framework",
    "sinatra",
    "web",
    "http",
    "rest",
    "restful",
    "router",
    "app",
    "api"
  ],
  "dependencies": {
    "accepts": "^2.0.0",
    "body-parser": "^2.4.0",
    "content-disposition": "^2.0.1",
    "content-type": "^2.0.0",
    "cookie": "^0.7.1",
    "cookie-signature": "^1.2.1",
    "debug": "^4.4.0",
    "depd": "^2.0.0",
    "encodeurl": "^2.0.0",
    "escape-html": "^1.0.3",
    "etag": "^1.8.1",
    "finalhandler": "^2.1.0",
    "fresh": "^2.0.0",
    "http-errors": "^2.0.0",
    "merge-descriptors": "^2.0.0",
    "mime-types": "^3.0.0",
    "on-finished": "^2.4.1",
    "once": "^1.4.0",
    "parseurl": "^1.3.3",
    "proxy-addr": "^2.0.8",
    "qs": "^6.16.0",
    "range-parser": "^1.2.1",
    "router": "^2.2.0",
    "send": "^1.1.0",
    "serve-static": "^2.2.0",
    "statuses": "^2.0.1",
    "type-is": "^2.1.0",
    "vary": "^1.1.2"
  },
  "devDependencies": {
    "after": "0.8.2",
    "connect-redis": "^8.0.1",
    "cookie-parser": "1.4.7",
    "cookie-session": "2.1.1",
    "ejs": "^3.1.10",
    "eslint": "8.47.0",
    "express-session": "^1.18.1",
    "hbs": "4.4.0",
    "marked": "^15.0.3",
    "method-override": "3.0.0",
    "mocha": "^11.7.5",
    "morgan": "1.12.1",
    "nyc": "^17.1.0",
    "pbkdf2-password": "1.2.1",
    "supertest": "^6.3.0",
    "vhost": "~3.0.2"
  },
  "engines": {
    "node": ">= 18"
  },
  "files": [
    "LICENSE",
    "Readme.md",
    "index.js",
    "lib/"
  ],
  "scripts": {
    "lint": "eslint .",
    "lint:fix": "eslint . --fix",
    "test": "mocha --require test/support/env --reporter spec --check-leaks test/ test/acceptance/",
    "test-ci": "nyc --exclude examples --exclude test --exclude benchmarks --reporter=lcovonly --reporter=text npm test",
    "test-cov": "nyc --exclude examples --exclude test --exclude benchmarks --reporter=html --reporter=text npm test",
    "test-tap": "mocha --require test/support/env --reporter tap --check-leaks test/ test/acceptance/"
  }
}

Output

out.yaml 2.1 KB
name: express
description: Fast, unopinionated, minimalist web framework
version: '5.3.0'
author: TJ Holowaychuk <[email protected]>
contributors:
- Aaron Heckmann <[email protected]>
- Ciaran Jessup <[email protected]>
- Douglas Christopher Wilson <[email protected]>
- Guillermo Rauch <[email protected]>
- Jonathan Ong <[email protected]>
- Roman Shtylman <[email protected]>
- Young Jae Sim <[email protected]>
license: MIT
repository: expressjs/express
homepage: https://expressjs.com/
funding:
  type: opencollective
  url: https://opencollective.com/express
keywords:
- express
- framework
- sinatra
- web
- http
- rest
- restful
- router
- app
- api
dependencies:
  accepts: ^2.0.0
  body-parser: ^2.4.0
  content-disposition: ^2.0.1
  content-type: ^2.0.0
  cookie: ^0.7.1
  cookie-signature: ^1.2.1
  debug: ^4.4.0
  depd: ^2.0.0
  encodeurl: ^2.0.0
  escape-html: ^1.0.3
  etag: ^1.8.1
  finalhandler: ^2.1.0
  fresh: ^2.0.0
  http-errors: ^2.0.0
  merge-descriptors: ^2.0.0
  mime-types: ^3.0.0
  on-finished: ^2.4.1
  once: ^1.4.0
  parseurl: ^1.3.3
  proxy-addr: ^2.0.8
  qs: ^6.16.0
  range-parser: ^1.2.1
  router: ^2.2.0
  send: ^1.1.0
  serve-static: ^2.2.0
  statuses: ^2.0.1
  type-is: ^2.1.0
  vary: ^1.1.2
devDependencies:
  after: '0.8.2'
  connect-redis: ^8.0.1
  cookie-parser: '1.4.7'
  cookie-session: '2.1.1'
  ejs: ^3.1.10
  eslint: '8.47.0'
  express-session: ^1.18.1
  hbs: '4.4.0'
  marked: ^15.0.3
  method-override: '3.0.0'
  mocha: ^11.7.5
  morgan: '1.12.1'
  nyc: ^17.1.0
  pbkdf2-password: '1.2.1'
  supertest: ^6.3.0
  vhost: ~3.0.2
engines:
  node: '>= 18'
files:
- LICENSE
- Readme.md
- index.js
- lib/
scripts:
  lint: eslint .
  lint:fix: eslint . --fix
  test: mocha --require test/support/env --reporter spec --check-leaks test/ test/acceptance/
  test-ci: nyc --exclude examples --exclude test --exclude benchmarks --reporter=lcovonly --reporter=text npm test
  test-cov: nyc --exclude examples --exclude test --exclude benchmarks --reporter=html --reporter=text npm test
  test-tap: mocha --require test/support/env --reporter tap --check-leaks test/ test/acceptance/
What it printed
ok json.convert express.json -> out.yaml  2KB  0.00s
Automatic checks (1)
  • python: code = "import yaml; d = yaml.safe_load(open('out.yaml')); assert d['name'] == 'express' and 'dependencies' in d, list(d)"