{"id":16269539,"url":"https://github.com/av/dtg","last_synced_at":"2026-04-10T20:53:01.369Z","repository":{"id":57216826,"uuid":"55671503","full_name":"av/dtg","owner":"av","description":"Data generation tool","archived":false,"fork":false,"pushed_at":"2022-12-05T22:25:41.000Z","size":10,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-03T13:52:31.004Z","etag":null,"topics":["data","data-engineering","data-generator","dtg","generator","node","nodejs","npm-module","npm-package","random-generation","utility"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/av.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-04-07T07:01:37.000Z","updated_at":"2025-12-18T06:15:35.000Z","dependencies_parsed_at":"2023-01-24T08:45:45.158Z","dependency_job_id":null,"html_url":"https://github.com/av/dtg","commit_stats":null,"previous_names":["iamfrontender/dtg"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/av/dtg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/av%2Fdtg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/av%2Fdtg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/av%2Fdtg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/av%2Fdtg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/av","download_url":"https://codeload.github.com/av/dtg/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/av%2Fdtg/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31658964,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T17:19:37.612Z","status":"ssl_error","status_checked_at":"2026-04-10T17:19:13.364Z","response_time":98,"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":["data","data-engineering","data-generator","dtg","generator","node","nodejs","npm-module","npm-package","random-generation","utility"],"created_at":"2024-10-10T18:08:34.490Z","updated_at":"2026-04-10T20:53:01.338Z","avatar_url":"https://github.com/av.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![DTG](https://img42.com/bkCep+)\n\n## What's DTG?\n\nDTG - DaTa Generator, allows you to develop your data generation scripts faster\n\n## Terms\n\n+ dtg - tool for data generation\n+ template - javascript object containing fields with generation operators\n+ generation operator - string strating with '$'\n+ plugin - code, existing in a sibling folder of dtg installation, which exports `install` function\n\n## Installation\n\n```bash\nnpm install dtg\n```\n\n## Usage\n\n```javascript\nconst gen = require('dtg').generate;\nconst template = {\n    {\n        // Will be kept as is in output objects\n        type: '_ShipmentOrder',\n\n        // The same, will not be modified\n        timestamp: Date.now(),\n\n        // It's possible to put generation operators in the any\n        // place in object, except field's name\n        tags: ['some', '$pattern:NN-CC'],\n        customFields: {\n\n            // Timestamp generator, will produce timestamp, from one to two months ago\n            shipment_date: `$timestamp: 1..2M ago`,\n\n            // Will chose random value from given array\n            shipment_order: `$enum: ['EZ-104', 'BD-103', 'SO12', 'FDk2', 'DZ-105']`,\n            shipment_to_code: `$enum: ['14RD', '13SD', '22LD', '45SA', '14RA', '21SO', '56LS']`,\n\n            // Will produce random int in given range, floats supported via\n            // $float generation operator\n            quantity: `$int: 10..100`\n      }\n    }\n};\n\nlet actions = [];\n\nwhile (actions.length \u003c 100) {\n    // Will produce 100 diferrent objects from template given.\n    actions.push(gen(template));\n}\n\n```\n\n## Plugins\n\nDTG loads plugins automatically. The only place to locate them is a sibling folder of a dtg installation itself.\nE.g.\n```\n/node_modules\n  /dtg\n  /dtg-plugin\n```\nPlugin must have either export a function or `install` field with function value in its exports. The function will retrieve the main DTG object when called and therefore do whatever needed.\nE.g.\n```\nmodule.exports = {\n    install: function(dtg) {\n        dtg['curl'] = require('./curl-generator')\n    }\n}\n\nmodule.exports = function(dtg) {\n    dtg['search-results'] = require('google-connector');\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fav%2Fdtg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fav%2Fdtg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fav%2Fdtg/lists"}