{"id":13451845,"url":"https://github.com/json-schema-faker/json-schema-faker","last_synced_at":"2026-02-20T06:02:12.143Z","repository":{"id":21594190,"uuid":"24914297","full_name":"json-schema-faker/json-schema-faker","owner":"json-schema-faker","description":"JSON-Schema + fake data generators","archived":false,"fork":false,"pushed_at":"2026-02-17T05:42:17.000Z","size":26104,"stargazers_count":3426,"open_issues_count":85,"forks_count":341,"subscribers_count":40,"default_branch":"master","last_synced_at":"2026-02-17T11:17:02.659Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://json-schema-faker.js.org/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/json-schema-faker.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"custom":"https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=8MXLRJ7QQXGYY\u0026source=url","open_collective":"json-schema-faker","github":"pateketrueke","ko-fi":"pateketrueke"}},"created_at":"2014-10-07T22:23:13.000Z","updated_at":"2026-02-12T08:14:50.000Z","dependencies_parsed_at":"2024-02-20T22:25:17.858Z","dependency_job_id":"f086d375-6a7f-4a61-9e90-7fb88688cca8","html_url":"https://github.com/json-schema-faker/json-schema-faker","commit_stats":{"total_commits":1224,"total_committers":69,"mean_commits":17.73913043478261,"dds":0.2785947712418301,"last_synced_commit":"d4403ae6cdba2206fe86399900c4095de8db7d2a"},"previous_names":["pateketrueke/json-schema-faker"],"tags_count":99,"template":false,"template_full_name":null,"purl":"pkg:github/json-schema-faker/json-schema-faker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/json-schema-faker%2Fjson-schema-faker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/json-schema-faker%2Fjson-schema-faker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/json-schema-faker%2Fjson-schema-faker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/json-schema-faker%2Fjson-schema-faker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/json-schema-faker","download_url":"https://codeload.github.com/json-schema-faker/json-schema-faker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/json-schema-faker%2Fjson-schema-faker/sbom","scorecard":{"id":538790,"data":{"date":"2025-08-11","repo":{"name":"github.com/json-schema-faker/json-schema-faker","commit":"89a97aa89915ecfff4f4ca06a4e2909861871f0c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.2,"checks":[{"name":"Code-Review","score":8,"reason":"Found 12/14 approved changesets -- score normalized to 8","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/release.yml:1","Warn: no topLevel permission defined: .github/workflows/testing.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/json-schema-faker/json-schema-faker/release.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/json-schema-faker/json-schema-faker/release.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/testing.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/json-schema-faker/json-schema-faker/testing.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-20T07:40:59.324Z","repository_id":21594190,"created_at":"2025-08-20T07:40:59.325Z","updated_at":"2025-08-20T07:40:59.325Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29642906,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-20T05:21:04.652Z","status":"ssl_error","status_checked_at":"2026-02-20T05:21:04.238Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T07:01:04.525Z","updated_at":"2026-02-20T06:02:12.137Z","avatar_url":"https://github.com/json-schema-faker.png","language":"JavaScript","funding_links":["https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=8MXLRJ7QQXGYY\u0026source=url","https://opencollective.com/json-schema-faker","https://github.com/sponsors/pateketrueke","pateketrueke"],"categories":["JavaScript","Projects using `@faker-js/faker`","Misc","JSON Schema Tools"],"sub_categories":[],"readme":"# json-schema-faker\n\nGenerate valid JSON data from JSON Schema definitions. Zero production dependencies.\n\n```typescript\nimport { generate } from \"json-schema-faker\";\n\nconst data = await generate({\n  type: \"object\",\n  properties: {\n    name: { type: \"string\", minLength: 2 },\n    age: { type: \"integer\", minimum: 0, maximum: 120 },\n    email: { type: \"string\", format: \"email\" },\n    tags: { type: \"array\", items: { type: \"string\" }, maxItems: 3 }\n  },\n  required: [\"name\", \"email\"]\n});\n```\n\n## Features\n\n- Supports JSON Schema 2019-09 and 2020-12\n- Deterministic output via seeded PRNG (Mulberry32)\n- All standard types: null, boolean, integer, number, string, array, object\n- Composition keywords: `allOf`, `anyOf`, `oneOf`, `not`, `if`/`then`/`else` (JSON Schema 2020-12)\n- `$ref` resolution with cycle detection and configurable recursion depth\n- Remote `$ref` resolution (HTTP/file) via `createRemoteResolver()`\n- Built-in format generators: date-time, email, uri, hostname, ipv4/ipv6, uuid, json-pointer\n- Regex `pattern` support via AST-based string generator\n- Built-in keywords: `autoIncrement`, `template` (string interpolation)\n- Extension support for [faker](https://fakerjs.dev/) and [chance](https://chancejs.com/)\n- Custom format registration via `registerFormat()`\n- Custom keyword extensions via `define()`\n\n## Install\n\n```bash\nnpm install json-schema-faker\n# or\nbun add json-schema-faker\n```\n\n## API\n\n### `generate(schema, options?)`\n\nGenerate a value from a JSON Schema. Returns `Promise\u003cunknown\u003e`.\n\n```typescript\nconst value = await generate({ type: \"string\", format: \"email\" });\n```\n\n### `createGenerator(options?)`\n\nCreate a reusable generator with auto-incrementing seeds, producing different output on each call.\n\n```typescript\nconst gen = createGenerator({ seed: 42 });\nconst a = await gen.generate(schema); // seed 42\nconst b = await gen.generate(schema); // seed 43\n```\n\n### `registerFormat(name, generator)`\n\nRegister a custom format generator globally.\n\n```typescript\nregisterFormat(\"phone\", (random) =\u003e {\n  const area = random.int(200, 999);\n  const num = random.int(1000000, 9999999);\n  return `+1-${area}-${num}`;\n});\n```\n\n### `createRemoteResolver(options?)`\n\nCreate a `$ref` resolver for external schemas (URLs or files).\n\n```typescript\nimport { generate, createRemoteResolver } from \"json-schema-faker\";\n\nconst resolver = createRemoteResolver({\n  baseUrl: \"https://example.com/schemas/\"\n});\n\nawait generate(schema, { refResolver: resolver });\n```\n\n### `define(name, callback)`\n\nRegister a custom keyword generator. The callback receives `value` (keyword value from schema) and `schema` (full schema). Use `this` to persist state across calls.\n\n```typescript\ndefine(\"counter\", function() {\n  return ++this.count;\n});\n\ndefine(\"uuid\", function() {\n  return crypto.randomUUID();\n});\n```\n\n### `reset(name?)`\n\nClear registered custom keywords. Call without arguments to clear all.\n\n```typescript\nreset(\"counter\"); // clear specific\nreset();          // clear all\n```\n\n## Options\n\n```typescript\nawait generate(schema, {\n  // Seeding \u0026 limits\n  seed: 12345,                       // Random seed (default: 1)\n  maxDepth: 5,                       // Max recursion depth (default: 5)\n  maxDefaultItems: 3,                // Default max array items (default: 3)\n\n  // Property generation\n  optionalsProbability: 0.5,           // Probability of optional properties (default: 0.5)\n  alwaysFakeOptionals: true,           // Always generate optional properties\n  fillProperties: true,                // Fill beyond required properties\n  fixedProbabilities: true,            // Deterministic probabilities for testing\n  pruneProperties: [\"internal\"],       // Remove properties from output\n\n  // Schema overrides\n  minItems: 2,                       // Override schema minItems\n  maxItems: 10,                      // Override schema maxItems\n  minLength: 5,                      // Override schema minLength\n  maxLength: 20,                     // Override schema maxLength\n\n  // Value sources\n  useDefaultValue: true,             // Use schema `default` values\n  useExamplesValue: true,            // Use schema `examples` values\n\n  // $ref recursion\n  refDepthMin: 1,                    // Minimum $ref recursion depth\n  refDepthMax: 5,                    // Maximum $ref recursion depth\n  refDepth: 3,                       // Set both min and max to same value\n\n  // Date-time range\n  minDateTime: \"2000-01-01\",\n  maxDateTime: \"2025-12-31\",\n\n  // Invalid types\n  failOnInvalidTypes: false,         // Return default instead of throwing\n  defaultInvalidTypeProduct: null,   // Value for invalid types\n\n  // Extensions\n  resolveJsonPath: true,             // Enable jsonPath cross-references\n  validateSchemaVersion: true,       // Throw on unsupported $schema\n  formats: {                         // Inline custom formats\n    custom: (random) =\u003e \"value\"\n  },\n  refResolver: myResolver,          // Custom $ref resolver\n  extensions: {                      // faker/chance instances\n    faker: fakerInstance,\n    chance: chanceInstance,\n  }\n});\n```\n\n## Extensions (faker / chance)\n\nUse faker or chance to generate realistic data. Works for all types:\n\n```typescript\nimport { faker } from \"@faker-js/faker\";\n\nawait generate({\n  type: \"object\",\n  properties: {\n    name: { type: \"string\", faker: \"person.fullName\" },\n    email: { faker: \"internet.email\" },\n    age: { type: \"integer\", faker: { \"number.int\": [{ min: 18, max: 65 }] } },\n    active: { type: \"boolean\", chance: \"bool\" },\n  }\n}, { extensions: { faker } });\n```\n\nValues are automatically cast to match the schema's `type`.\n\n## CLI\n\nInstall globally to use from command line:\n\n```bash\nnpm install -g json-schema-faker\njsf schema.json\n```\n\n### CLI Usage\n\n```bash\njsf \u003cschema.json\u003e [options]\n```\n\n**Arguments:**\n- `schema.json` - Path to JSON schema file (use `-` for stdin)\n\n**Options:**\n```\n-o, --output \u003cfile\u003e   Output file path (default: stdout)\n-c, --count \u003cn\u003e       Generate N items as array\n    --options \u003cfile\u003e  Path to options JSON file\n    --seed \u003cn\u003e        Random seed for deterministic output\n    --max-depth \u003cn\u003e   Maximum recursion depth (default: 5)\n    --min-items \u003cn\u003e   Override minItems for arrays\n    --max-items \u003cn\u003e   Override maxItems for arrays\n    --min-length \u003cn\u003e  Override minLength for strings\n    --max-length \u003cn\u003e  Override maxLength for strings\n    --optionals \u003c0-1\u003e Probability for optional properties\n    --all-optionals   Include all optional properties\n    --use-defaults    Use schema default values\n    --use-examples    Use schema examples values\n    --resolve-jsonpath Enable JSONPath resolution\n    --prune \u003cprops\u003e   Comma-separated properties to remove\n    --pretty          Pretty print output (default)\n    --no-pretty       Compact output\n```\n\n**Examples:**\n```bash\n# Generate to stdout\njsf schema.json\n\n# Generate to file\njsf schema.json -o output.json\n\n# Generate 10 items as array\njsf schema.json -c 10\n\n# With seed for reproducible output\njsf schema.json --seed 42\n\n# Include all optional properties\njsf schema.json --all-optionals\n\n# Combine options\njsf schema.json -o output.json -c 5 --seed 42\n\n# Read from stdin\ncat schema.json | jsf -\n```\n\n### Standalone Binaries\n\nDownload platform-specific binaries from [GitHub Releases](https://github.com/json-schema-faker/json-schema-faker/releases):\n- `jsf-linux-x64`\n- `jsf-linux-arm64`\n- `jsf-darwin-x64` (macOS Intel)\n- `jsf-darwin-arm64` (macOS Apple Silicon)\n- `jsf-windows-x64.exe`\n\n## Development\n\n```bash\nmake dev          # Run development mode (tequio-dev)\nmake test         # Run all tests\nmake test_all     # Run all tests including skipped\nmake typecheck    # TypeScript type checking\nmake build        # Build the project\nmake check        # Run typecheck + test\nmake ci           # Full CI check (typecheck + test_all + build)\n```\n\n## License\n\nMIT\n\n\u003e The new implementation reuses the `v0.5.x` ideas but is rewritten in TypeScript for Bun with zero production dependencies.\n\u003e\n\u003e It emphasizes a clear, typed API (generate, createGenerator, registerFormat, createRemoteResolver) and a focused runtime suitable for Node-like or Bun environments.\n\u003e\n\u003e If you rely on the original behavior or want historical reference, you can review the previous work at: [https://github.com/json-schema-faker/json-schema-faker/tree/0.5.x][jsf]\n\n[jsf]: https://github.com/json-schema-faker/json-schema-faker/tree/0.5.x\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjson-schema-faker%2Fjson-schema-faker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjson-schema-faker%2Fjson-schema-faker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjson-schema-faker%2Fjson-schema-faker/lists"}