{"_id":"@avelor/ttl","name":"@avelor/ttl","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@avelor/ttl","version":"1.0.0","description":"SSL certificate expiry checker. Warns before certs expire. CI-friendly.","keywords":["ssl","tls","certificate","expiry","https","monitoring","ci","developer-tools"],"license":"MIT","author":{"name":"Avelor","email":"cruz@avelor.es"},"repository":{"type":"git","url":"git+https://github.com/avelor-es/ttl.git"},"publishConfig":{"access":"public"},"type":"module","bin":{"ttl":"bin/ttl.js"},"dependencies":{"js-yaml":"^4.1.0"},"scripts":{"test":"node --test"},"engines":{"node":">=18"},"gitHead":"5acc2c916f856f90d0849a52523e7ac8b394291c","_id":"@avelor/ttl@1.0.0","bugs":{"url":"https://github.com/avelor-es/ttl/issues"},"homepage":"https://github.com/avelor-es/ttl#readme","_nodeVersion":"24.13.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-jfTRSWliCITZ8bf/j6O2Z2aJy6nEibfL2VDN7PfGGgwh5z1koUPFttkynaba9ErYIYax/oLBvw9SrUMvNH0bbw==","shasum":"77f846d8e236041dab339d4b7a3bc6d6d9867dd7","tarball":"https://registry.npmjs.org/@avelor/ttl/-/ttl-1.0.0.tgz","fileCount":9,"unpackedSize":11637,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD977PdgXn+hEVBOlxGdRpC5+yA2i17k47W2HEmnHWK7wIhANfJCMxRMtBLSej/7WUJuzclCOhmkzcttyPY5pnKYNMa"}]},"_npmUser":{"name":"christianecg","email":"contacto@christianecg.com"},"directories":{},"maintainers":[{"name":"christianecg","email":"contacto@christianecg.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ttl_1.0.0_1780506519504_0.8029403050979913"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-03T17:08:39.332Z","1.0.0":"2026-06-03T17:08:39.665Z","modified":"2026-06-03T17:08:39.908Z"},"maintainers":[{"name":"christianecg","email":"contacto@christianecg.com"}],"description":"SSL certificate expiry checker. Warns before certs expire. CI-friendly.","homepage":"https://github.com/avelor-es/ttl#readme","keywords":["ssl","tls","certificate","expiry","https","monitoring","ci","developer-tools"],"repository":{"type":"git","url":"git+https://github.com/avelor-es/ttl.git"},"author":{"name":"Avelor","email":"cruz@avelor.es"},"bugs":{"url":"https://github.com/avelor-es/ttl/issues"},"license":"MIT","readme":"# ttl\n\nSSL certificate expiry checker. Warns before certs expire. CI-friendly.\n\n![demo](demo.gif)\n\n```\n  ✓  avelor.es        76d             expires 2026-08-17 · Let's Encrypt\n  ✓  api.avelor.es    76d             expires 2026-08-17 · Let's Encrypt\n  ✖  old.avelor.es    expired 3d ago  expires 2026-05-30 · Let's Encrypt\n\n  ✖ 1 cert below threshold (30d).\n```\n\n---\n\n## Install\n\n```bash\nnpm install -g @avelor/ttl\n```\n\nRequires Node.js 18+.\n\n---\n\n## Usage\n\n```bash\nttl                            # scan using .ttl.yml in current directory\nttl avelor.es api.avelor.es    # check domains directly\nttl --threshold 14             # warn when less than 14 days remain\nttl --format github            # GitHub Actions annotations\n```\n\nExit code is `0` if all certs are above the threshold, `1` if any are not — including connection errors.\n\n---\n\n## .ttl.yml\n\n```yaml\nthreshold: 30\ntimeout: 10000\n\ndomains:\n  - avelor.es\n  - api.avelor.es\n  - app.avelor.es\n```\n\nDomains passed as CLI arguments override the config file list entirely.\n\n| Field       | Description                                               | Default |\n|-------------|-----------------------------------------------------------|---------|\n| `threshold` | Days remaining before a cert is considered a violation    | `30`    |\n| `timeout`   | Connection timeout per domain, in milliseconds            | `10000` |\n| `domains`   | List of domains to check (port 443)                       | —       |\n\n---\n\n## CI / GitHub Actions\n\nUse `--format github` to emit native annotations that appear inline on the PR or workflow summary.\n\n```yaml\n- name: Check SSL certificates\n  run: npx @avelor/ttl --format github\n```\n\nOutput:\n\n```\n::error::ttl: old.avelor.es expires in -3d (threshold: 30d)\n::warning::ttl: staging.avelor.es expires in 12d (threshold: 30d)\n```\n\nErrors for certs below the threshold. Warnings for certs within 1.5× the threshold.\n\nFor scheduled monitoring, run it as a cron job:\n\n```yaml\non:\n  schedule:\n    - cron: '0 9 * * 1'  # every Monday at 9am\n```\n\n---\n\n## Options\n\n```\n--threshold <days>   Warn when cert expires within N days (default: 30)\n--format <type>      human (default), json, github\n--config <path>      Path to config file (default: .ttl.yml)\n-v, --version\n-h, --help\n```\n\n---\n\n## JSON output\n\n```bash\nttl --format json | jq '.[] | select(.violation)'\n```\n\nEach entry:\n\n```json\n{\n  \"domain\": \"avelor.es\",\n  \"daysLeft\": 76,\n  \"expiresAt\": \"2026-08-17\",\n  \"issuer\": \"Let's Encrypt\",\n  \"violation\": false\n}\n```\n\nOn connection errors, `error` replaces the cert fields and `violation` is `true`.\n\n---\n\n## How it works\n\n`ttl` opens a TLS connection to each domain on port 443, reads the peer certificate, and calculates the number of days until `valid_to`. All domains are checked in parallel. No external dependencies — uses Node's built-in `tls` module.\n\n---\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-3bca65938a1d138193e9da8a9892ad90"}