{"_id":"@apijack/plugin-faker","_rev":"4-cffaec7af709d37b01ba2ff6958f8d6a","name":"@apijack/plugin-faker","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.1":{"name":"@apijack/plugin-faker","version":"1.0.1","keywords":["apijack","faker","plugin","routine","test-data"],"author":{"name":"normalled"},"license":"MIT","_id":"@apijack/plugin-faker@1.0.1","maintainers":[{"name":"garretpremo","email":"garretpremo@gmail.com"}],"homepage":"https://github.com/normalled/apijack-plugin-faker#readme","bugs":{"url":"https://github.com/normalled/apijack-plugin-faker/issues"},"dist":{"shasum":"43083be85054000a15dbebb64d9fe7250b182027","tarball":"https://registry.npmjs.org/@apijack/plugin-faker/-/plugin-faker-1.0.1.tgz","fileCount":27,"integrity":"sha512-OYvAXQKfe5jfDExj+3eS4Ad+P9/G3sQ0YYpToEtOE8YKJaCCQncvMW+roB7sdZ2PsaJsYGxhmQ8aGDmyPCWYeQ==","signatures":[{"sig":"MEQCIDddgtCfpblthRTmDKxxWyAAal8WDSLYRiN21veeprj/AiA7/Dy1gNFcLPSIBSRTRwWbGOnAoOqRRBdkP9Iv5ycTvw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":21854},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"bun":">=1.1","node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"0099d12caef465dc41188b269a041209be89b4a1","scripts":{"lint":"eslint src tests","test":"bun test","build":"tsc -p tsconfig.build.json --noCheck","prepack":"bun run build","lint:fix":"eslint src tests --fix"},"_npmUser":{"name":"garretpremo","email":"garretpremo@gmail.com"},"repository":{"url":"git+https://github.com/normalled/apijack-plugin-faker.git","type":"git"},"_npmVersion":"11.6.2","description":"Wrap @faker-js/faker for apijack routines","directories":{},"_nodeVersion":"24.13.0","dependencies":{"json5":"^2.2.3","@faker-js/faker":"^9.0.0"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.0.0","@types/bun":"latest","typescript":"^5.4.0","@apijack/core":"^1.9.0","@typescript-eslint/parser":"^7.0.0","@typescript-eslint/eslint-plugin":"^7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/plugin-faker_1.0.1_1777151168031_0.32089771502502473","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@apijack/plugin-faker","version":"1.0.2","description":"Wrap @faker-js/faker for apijack routines","type":"module","main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"build":"tsc -p tsconfig.build.json --noCheck","test":"bun test","lint":"eslint src tests","lint:fix":"eslint src tests --fix","prepack":"bun run build"},"keywords":["apijack","faker","plugin","routine","test-data"],"author":{"name":"normalled"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/normalled/apijack-plugin-faker.git"},"dependencies":{"@faker-js/faker":"^9.0.0","json5":"^2.2.3"},"peerDependencies":{"@apijack/core":"^1.0.0"},"devDependencies":{"@apijack/core":"^1.9.0","@types/bun":"latest","typescript":"^5.4.0","eslint":"^9.0.0","@typescript-eslint/parser":"^7.0.0","@typescript-eslint/eslint-plugin":"^7.0.0"},"engines":{"node":">=20","bun":">=1.1"},"gitHead":"029b5a59b1d7fd3b179fb359d47eaf3f94cc1633","_id":"@apijack/plugin-faker@1.0.2","bugs":{"url":"https://github.com/normalled/apijack-plugin-faker/issues"},"homepage":"https://github.com/normalled/apijack-plugin-faker#readme","_nodeVersion":"24.13.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-RHja2EZfy77aSdEqvnTULZXo+KtvfTTw6q3VWduw26o5tvsh2lJajiT+Zcm4rVcHDU2FP7ycQvZ4t6dhVr3FLQ==","shasum":"67728a551480049a8a02145733b904fc0adcd852","tarball":"https://registry.npmjs.org/@apijack/plugin-faker/-/plugin-faker-1.0.2.tgz","fileCount":27,"unpackedSize":21913,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDE2/SyLU0N4LXzbm2l5ybBijyNpnk61cEQBexTYOb5agIhAOazDfgUl5gRIhe0YOXTEvMfd0GdzwosDkjh+6KCOErx"}]},"_npmUser":{"name":"garretpremo","email":"garretpremo@gmail.com"},"directories":{},"maintainers":[{"name":"garretpremo","email":"garretpremo@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/plugin-faker_1.0.2_1777208900833_0.938765039345183"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-23T18:42:43.742Z","modified":"2026-04-26T13:08:21.110Z","1.0.0":"2026-04-23T18:42:43.999Z","1.0.1":"2026-04-25T21:06:08.222Z","1.0.2":"2026-04-26T13:08:20.988Z"},"bugs":{"url":"https://github.com/normalled/apijack-plugin-faker/issues"},"author":{"name":"normalled"},"license":"MIT","homepage":"https://github.com/normalled/apijack-plugin-faker#readme","keywords":["apijack","faker","plugin","routine","test-data"],"repository":{"type":"git","url":"git+https://github.com/normalled/apijack-plugin-faker.git"},"description":"Wrap @faker-js/faker for apijack routines","maintainers":[{"name":"garretpremo","email":"garretpremo@gmail.com"}],"readme":"# @apijack/plugin-faker\n\nWrap [@faker-js/faker](https://www.npmjs.com/package/@faker-js/faker) for apijack routines. Call any faker function by dotted path from routine YAML with the exact same arguments you'd use in JavaScript.\n\n## Install\n\n```bash\nbun add @apijack/plugin-faker\n# or: npm install @apijack/plugin-faker\n```\n\nRequires `@apijack/core` `^1.0.0` as a peer dependency.\n\n## Usage\n\nRegister the plugin on your CLI:\n\n```ts\nimport { createCli } from '@apijack/core';\nimport faker from '@apijack/plugin-faker';\n\nconst cli = createCli({ name: 'mycli', /* ... */ });\ncli.use(faker());                       // zero-config\ncli.use(faker({ seed: 42 }));           // global defaults\nawait cli.run();\n```\n\nCall `$_faker(path, ...args)` in a routine:\n\n```yaml\nname: seed-users\nplugins:\n  faker:\n    seed: 42\n    locale: en\nsteps:\n  - name: create\n    command: users create\n    args:\n      --name:  '$_faker(person.fullName)'\n      --email: '$_faker(internet.email)'\n      --age:   '$_faker(number.int, {min: 18, max: 80})'\n      --tags:  '$_faker(helpers.arrayElements, [\"ops\", \"sales\", \"eng\"], 2)'\n```\n\nThe first arg is the faker path (dotted, unquoted). Remaining args are JSON5-parsed — so unquoted keys, single quotes, and multi-line layouts all work:\n\n```yaml\n--user: |\n  $_faker(person.fullName, {\n    firstName: \"Alex\",\n    sex: 'female',\n    locale: en,\n  })\n```\n\n## `$ref` substitution\n\nTo splice a routine variable into a faker call, quote the `$ref` inside the arg:\n\n```yaml\nvariables:\n  role: \"admin\"\nsteps:\n  - name: mk\n    command: users create\n    args:\n      --name: '$_faker(internet.username)'\n      --tag:  '$_faker(helpers.arrayElement, [\"user\", \"$role\"])'\n```\n\nAn exact-match quoted `$ref` like `\"$role\"` substitutes with the resolved value in its native type. A quoted interpolated string like `\"tag-$role-v2\"` yields a string.\n\n## Seed and locale per routine\n\nPer-routine options go under `plugins.faker:`:\n\n```yaml\nname: deterministic-check\nplugins:\n  faker:\n    seed: 7\n    locale: de\nsteps: [...]\n```\n\nEach routine invocation gets a fresh `Faker` instance. Routines are isolated from each other — seed state never leaks across routines.\n\n## Path reference\n\nThe plugin walks faker's object graph, so every path in the [faker docs](https://fakerjs.dev/api/) works: `person.firstName`, `internet.email`, `number.int`, `helpers.arrayElement`, `date.past`, `string.alpha`, and so on.\n\n## Versioning\n\nPlugin major versions track `@apijack/core` major versions. A plugin `v1.x.x` is compatible with any `@apijack/core@^1.0.0`. When core bumps major, the plugin bumps major in lockstep.\n\n## License\n\nMIT.\n","readmeFilename":"README.md"}