{"_id":"@bilalshareef/jy","name":"@bilalshareef/jy","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@bilalshareef/jy","description":"Convert between JSON and YAML formats","version":"1.0.0","author":{"name":"Mohammed Bilal Shareef"},"bin":{"jy":"bin/run.js"},"bugs":{"url":"https://github.com/bilalshareef/jy/issues"},"dependencies":{"@oclif/core":"^4","@oclif/plugin-help":"^6","yaml":"^2.9.0"},"devDependencies":{"@eslint/compat":"^1","@oclif/test":"^4","@types/chai":"^4","@types/mocha":"^10","@types/node":"^22","chai":"^4","eslint":"^9","eslint-config-oclif":"^6","eslint-config-prettier":"^10","husky":"^9.1.7","mocha":"^11","oclif":"^4","prettier":"^3","shx":"^0.3.3","tsx":"^4.22.0","typescript":"^5"},"engines":{"node":">=22.0.0"},"homepage":"https://bilalshareef.github.io/jy/","keywords":["json","yaml","converter","cli","oclif"],"license":"MIT","main":"lib/index.js","type":"module","oclif":{"bin":"jy","dirname":"jy","commands":{"strategy":"single","target":"./lib/commands/index.js"},"plugins":["@oclif/plugin-help"],"topicSeparator":" ","update":{"node":{"version":"22.16.0","targets":["linux-x64","linux-arm64","darwin-x64","darwin-arm64","win32-x64"]}}},"repository":{"type":"git","url":"git+https://github.com/bilalshareef/jy.git"},"scripts":{"build":"tsc -b","build:clean":"shx rm -rf lib tsconfig.tsbuildinfo && tsc -b","format":"prettier --write \"src/**/*.ts\" \"test/**/*.ts\"","format:check":"prettier --check \"src/**/*.ts\" \"test/**/*.ts\"","lint":"eslint","pack:tarballs":"shx rm -rf dist && npm run build:clean && npx oclif pack tarballs","postpack":"shx rm -f oclif.manifest.json","posttest":"npm run lint && npm run format:check","prepare":"husky","prepack":"oclif manifest","test":"mocha --forbid-only \"test/**/*.test.ts\""},"types":"lib/index.d.ts","_id":"@bilalshareef/jy@1.0.0","gitHead":"473693bf90682d323bb4cb92fbaa9515811ecc5e","_nodeVersion":"22.22.3","_npmVersion":"10.9.8","dist":{"integrity":"sha512-9JID5vaD975jj9gOUOOUQNdmkyBb1jH0+otVlboHv/7kMH8O4xWw7v6nCd5xFGhn2sVUnZ/YF9FGfYytmMH/9w==","shasum":"46dc7678f42c7360121110f01c1a922f0450db02","tarball":"https://registry.npmjs.org/@bilalshareef/jy/-/jy-1.0.0.tgz","fileCount":26,"unpackedSize":27644,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD06U7rJKXqTQewMn0mYpnGDzoBp5RvfxRg2q6XxVgj+wIhAMZe6gDnweG7s+yJSl1dlBr+DYpUr4+LC8evr00dXI/p"}]},"_npmUser":{"name":"bilalshareef","email":"bilalshareef.h@gmail.com"},"directories":{},"maintainers":[{"name":"bilalshareef","email":"bilalshareef.h@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/jy_1.0.0_1780574241156_0.11817097859321035"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-04T11:57:21.030Z","1.0.0":"2026-06-04T11:57:21.320Z","modified":"2026-06-04T11:57:21.535Z"},"maintainers":[{"name":"bilalshareef","email":"bilalshareef.h@gmail.com"}],"description":"Convert between JSON and YAML formats","homepage":"https://bilalshareef.github.io/jy/","keywords":["json","yaml","converter","cli","oclif"],"repository":{"type":"git","url":"git+https://github.com/bilalshareef/jy.git"},"author":{"name":"Mohammed Bilal Shareef"},"bugs":{"url":"https://github.com/bilalshareef/jy/issues"},"license":"MIT","readme":"<p align=\"center\">\n  <h1 align=\"center\">jy</h1>\n  <p align=\"center\">\n    Convert between JSON and YAML — fast, correct, zero config.\n  </p>\n</p>\n\n<p align=\"center\">\n  <a href=\"https://github.com/bilalshareef/jy/actions\"><img src=\"https://github.com/bilalshareef/jy/workflows/CI/badge.svg\" alt=\"Build Status\"></a>\n  <a href=\"https://www.npmjs.com/package/@bilalshareef/jy\"><img src=\"https://img.shields.io/npm/v/@bilalshareef/jy.svg\" alt=\"npm version\"></a>\n  <a href=\"https://www.npmjs.com/package/@bilalshareef/jy\"><img src=\"https://img.shields.io/npm/dm/@bilalshareef/jy.svg\" alt=\"npm downloads\"></a>\n  <a href=\"https://github.com/bilalshareef/jy/blob/main/LICENSE\"><img src=\"https://img.shields.io/npm/l/@bilalshareef/jy.svg\" alt=\"license\"></a>\n  <img src=\"https://img.shields.io/node/v/@bilalshareef/jy.svg\" alt=\"node version\">\n</p>\n\n---\n\n`jy` is a cross-platform CLI tool that converts between JSON and YAML with zero configuration and zero runtime dependencies. It ships as a single binary — no Node.js, no package manager, no setup.\n\n```bash\n# That's it. JSON in, YAML out.\njy config.json > config.yaml\n\n# Or the other way around.\njy deployment.yaml > deployment.json\n```\n\n## Why jy?\n\nTools like [`yq`](https://github.com/mikefarah/yq) and [`jq`](https://github.com/jqlang/jq) are powerful, but they're overbuilt for the most common use case: *\"convert this file to the other format.\"* They come with query languages, transformation pipelines, and dozens of flags you'll never use for a simple format conversion.\n\n`jy` applies the Unix philosophy — **do one thing well** — to JSON ↔ YAML conversion. No query language, no transformation pipelines, no schema validation. Just `jy file.json` → YAML out. The value is in what it *doesn't* do.\n\n- **Zero friction** — install and convert your first file in under 60 seconds\n- **Zero config** — no `.jyrc`, no environment variables, no config files\n- **Zero dependencies** — standalone binary, no runtime required\n- **CI-ready** — deterministic exit codes, stdout/stderr separation, script-safe defaults\n\n## Installation\n\n### npm\n\n```bash\nnpm install -g @bilalshareef/jy\n```\n\nWorks on any platform supported by Node.js (requires Node.js >= 22).\n\n### Standalone binary\n\nPrebuilt binaries are available for common platforms — no Node.js required.\n\n**Linux / macOS:**\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/bilalshareef/jy/main/install.sh | sh\n```\n\nYou can customize the install location:\n\n```bash\nJY_INSTALL_DIR=$HOME/.local curl -fsSL https://raw.githubusercontent.com/bilalshareef/jy/main/install.sh | sh\n```\n\nOr install a specific version:\n\n```bash\nJY_VERSION=v1.0.0 curl -fsSL https://raw.githubusercontent.com/bilalshareef/jy/main/install.sh | sh\n```\n\n**Windows:**\n\nDownload the latest `.tar.gz` for `win32-x64` from the [Releases](https://github.com/bilalshareef/jy/releases) page and extract it to a directory on your `PATH`.\n\n**Supported platforms (standalone binary):**\n\n| Platform | Architecture |\n|---|---|\n| Linux | x64, arm64 |\n| macOS | Intel (x64), Apple Silicon (arm64) |\n| Windows | x64 |\n\n## Usage\n\n### Basic conversion\n\n```bash\n# JSON → YAML (format detected from extension)\njy config.json\n\n# YAML → JSON\njy config.yaml\n```\n\nOutput goes to stdout by default. Redirect to a file:\n\n```bash\njy config.json > config.yaml\n```\n\n### stdin / stdout\n\nUse `-` to read from stdin. The format is auto-detected (`{` or `[` → JSON, otherwise YAML):\n\n```bash\ncat config.json | jy -\necho '{\"key\": \"value\"}' | jy -\ncurl -s https://api.example.com/data | jy - > data.yaml\n```\n\n### Multiple files\n\nConvert multiple files at once using file paths or glob patterns:\n\n```bash\njy src/config.json src/settings.json\njy src/**/*.json\n```\n\n### Output directory\n\nWrite converted files to a directory with `--out`. Filenames are preserved with the extension swapped:\n\n```bash\njy src/**/*.json --out dist/\n# src/a.json → dist/a.yaml\n# src/b.json → dist/b.yaml\n```\n\n### Validation\n\nCheck if files are valid JSON or YAML without producing output:\n\n```bash\njy config.json --validate\njy src/**/*.yaml --validate\n```\n\n### Formatting options\n\nControl the output format:\n\n```bash\n# Set indentation (default: 2 spaces)\njy config.yaml --indent-size 4\n\n# Use tabs (JSON output only — YAML always uses spaces)\njy config.yaml --indent-style tabs\n\n# Set line endings\njy config.json --eol crlf\n```\n\n## Exit codes\n\n`jy` uses deterministic exit codes for reliable scripting and CI integration:\n\n| Code | Meaning | Example |\n|---|---|---|\n| `0` | Success | All files converted |\n| `1` | Validation error | `--validate` found invalid input |\n| `2` | Parse error | Input file is malformed |\n| `3` | I/O error | File not found, permission denied |\n| `4` | Ambiguous format | Mixed JSON and YAML files in one invocation |\n\n## CI/CD integration\n\n`jy` is designed to be a reliable building block in CI/CD pipelines.\n\n### GitHub Actions\n\n```yaml\njobs:\n  convert:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n      - name: Install jy\n        run: curl -fsSL https://raw.githubusercontent.com/bilalshareef/jy/main/install.sh | sh\n      - name: Convert configs\n        run: jy src/**/*.json --out dist/\n```\n\n### GitLab CI\n\n```yaml\nconvert:\n  image: node:22-alpine\n  before_script:\n    - npm install -g @bilalshareef/jy\n  script:\n    - jy src/**/*.json --out dist/\n```\n\n### Docker\n\n```dockerfile\nRUN curl -fsSL https://raw.githubusercontent.com/bilalshareef/jy/main/install.sh | sh\n```\n\n### Shell scripts\n\n```bash\n#!/bin/bash\nset -euo pipefail\n\n# Convert and fail the pipeline on malformed input\njy configs/*.yaml --out build/\n\n# Validate before deploying\njy k8s/*.yaml --validate || { echo \"Invalid YAML in k8s configs\"; exit 1; }\n```\n\nAll output goes to stdout (pipeable), all errors to stderr (separable), and exit codes are deterministic — no special handling required.\n\n## Flags reference\n\n| Flag | Values | Default | Description |\n|---|---|---|---|\n| `--out <dir>` | directory path | — | Write converted files to a directory |\n| `--validate` | — | — | Validate input without converting |\n| `--eol` | `lf`, `crlf` | `lf` | Line ending style |\n| `--indent-style` | `spaces`, `tabs` | `spaces` | Indentation style (JSON output only) |\n| `--indent-size` | positive integer | `2` | Indentation width (ignored with `--indent-style=tabs`) |\n\n## Requirements\n\n- **Standalone binary:** No dependencies — works out of the box\n- **npm install:** Node.js >= 22.0.0\n\n## Contributing\n\n```bash\ngit clone https://github.com/bilalshareef/jy.git\ncd jy\nnpm install\nnpm run build\nnpm test\n```\n\nDuring development, use `bin/dev.js` for hot-reloading without manual compilation:\n\n```bash\n./bin/dev.js config.json\n```\n\n## License\n\n[MIT](LICENSE) © Mohammed Bilal Shareef\n","readmeFilename":"README.md","_rev":"1-25a845445c895fa58014ef5738f208fa"}