{"id":20789123,"url":"https://github.com/umstek/sampler","last_synced_at":"2025-07-20T14:05:14.725Z","repository":{"id":25010942,"uuid":"102977599","full_name":"umstek/sampler","owner":"umstek","description":"Generate elaborate random data instantly.","archived":false,"fork":false,"pushed_at":"2025-07-05T07:47:14.000Z","size":597,"stargazers_count":0,"open_issues_count":34,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-05T08:37:32.102Z","etag":null,"topics":["data","faker","javascript","json","sample"],"latest_commit_sha":null,"homepage":"http://www.umstek.tk/sampler","language":"TypeScript","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/umstek.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2017-09-09T18:48:30.000Z","updated_at":"2021-03-14T12:05:28.000Z","dependencies_parsed_at":"2024-01-13T11:03:48.255Z","dependency_job_id":"1cb8d102-d48a-46b7-bcda-e00ffcf99107","html_url":"https://github.com/umstek/sampler","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/umstek/sampler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umstek%2Fsampler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umstek%2Fsampler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umstek%2Fsampler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umstek%2Fsampler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/umstek","download_url":"https://codeload.github.com/umstek/sampler/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umstek%2Fsampler/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266135685,"owners_count":23881803,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["data","faker","javascript","json","sample"],"created_at":"2024-11-17T15:19:44.692Z","updated_at":"2025-07-20T14:05:14.707Z","avatar_url":"https://github.com/umstek.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SamplerJS\n\nGenerate elaborate random data instantly.  \n![](https://github.com/umstek/sampler/workflows/CI/badge.svg)\n![](https://github.com/umstek/sampler/workflows/Package%20Deploy/badge.svg)\n[![codecov](https://codecov.io/gh/umstek/sampler/branch/master/graph/badge.svg)](https://codecov.io/gh/umstek/sampler)\n\n## How to use\n\n### Try it online\n\nView [demo](https://runkit.com/umstek/samplerjs-demo) or POST a JSON in correct format to https://samplerjs-demo-rqwiegzvqqfn.runkit.sh to get random data. (This is achieved with the help of RunKit and is rate-limited.)\n\n### Install\n\nRun:  \n`npm install samplerjs`  \nor,  \n`yarn add samplerjs`  \nif you're using yarn.\n\n**Use it on your project:**\n\n```js\nconst samplerjs = require(\"samplerjs\");\nconst parser = samplerjs.Parser.chanceParser;\nconst result = parser.parse({\n  user: {\n    firstName: {\n      $type: \"first\",\n      nationality: \"us\"\n    },\n    lastName: \"last\",\n    tel: \"phone\"\n  },\n  description: \"paragraph\"\n});\n```\n\n## Currently supported data types\n\nEverything supported by the excellent `chance`js library except,\n\n- Helper functions\n- `hidden`\n- `dice`\n- `n`\n- `unique`\n- `weighted`\n\nThese are to-be implemented in a \"sampler-native\" way in the future.\n\n## Object Format\n\n```js\nconst fillThisObject = {\n  someKey: \"typeThatDoesNotNeedArgs\",\n  otherKey: {\n    $type: \"typeThatNeedsArgs\",\n    arg1: \"someSimpleArg\",\n    arg2: {\n      // Argument that needs pre-processing\n      $type: \"type\",\n      arg1: \"arg\"\n    },\n    $process: [\"arg2\"] // Ask to preprocess arg2 as if it was anothe node in this object tree\n  }\n};\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumstek%2Fsampler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fumstek%2Fsampler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumstek%2Fsampler/lists"}