{"id":19197864,"url":"https://github.com/flarebyte/dazzling-fiction","last_synced_at":"2026-06-23T18:30:18.835Z","repository":{"id":145579558,"uuid":"40268492","full_name":"flarebyte/dazzling-fiction","owner":"flarebyte","description":"Fictional facts generator based on a given input","archived":false,"fork":false,"pushed_at":"2016-10-23T11:03:37.000Z","size":97,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-17T01:31:44.185Z","etag":null,"topics":["npm-cli"],"latest_commit_sha":null,"homepage":"","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/flarebyte.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}},"created_at":"2015-08-05T20:57:00.000Z","updated_at":"2023-05-13T07:09:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"56e5c6c6-510b-4a20-b0b6-5b6ca8240a81","html_url":"https://github.com/flarebyte/dazzling-fiction","commit_stats":{"total_commits":38,"total_committers":3,"mean_commits":"12.666666666666666","dds":"0.13157894736842102","last_synced_commit":"c6023af52ffee0bc0277ecd3d58180c67acddcf9"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flarebyte%2Fdazzling-fiction","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flarebyte%2Fdazzling-fiction/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flarebyte%2Fdazzling-fiction/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flarebyte%2Fdazzling-fiction/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flarebyte","download_url":"https://codeload.github.com/flarebyte/dazzling-fiction/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240271539,"owners_count":19774859,"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":["npm-cli"],"created_at":"2024-11-09T12:19:00.350Z","updated_at":"2026-06-23T18:30:18.778Z","avatar_url":"https://github.com/flarebyte.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"#  [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-url]][daviddm-image]\n\n\u003e Fictional facts generator based on a markdown fiction dialect\n\nThe fiction markdown dialect facilitates the creation of set of fictional (fake) data.\nThe output is a list of statements or facts, in which each fact is represented as subject-predicate-object format.\nHowever the object is not limited to one column and could be used in the same way as datalog.\nThe generated data is randomly created but in a predictable and repeatable manner.\n\nThe main purpose of this dialect is to experiment with different data samples which conform to a particular structure.\n\n## Install\n\n```sh\n$ npm install --save dazzling-fiction\n```\n\n\n## Usage\n\n```sh\n$ npm install --global dazzling-fiction\n$ fict --help\n```\n\n## Examples\n\n### Generate CSV\n```\ncat LICENSE |  fict run '2 of `Vegetable`' recipe \"test/fixtures\"\n```\n\nWill output:\n\n```\n\"ingredient\",\"child-of-fiction-model\",\"secret-spice\"\n\"olive-oil\",\"child-of-fiction-model\",\"sauce\"\n\"pepper\",\"child-of-fiction-model\",\"sauce\"\n\"diced-onion\",\"child-of-fiction-model\",\"sauce\"\n\"spice:Garlic/wild\",\"child-of-fiction-model\",\"sauce\"\n\"spice:Garlic/black\",\"child-of-fiction-model\",\"sauce\"\n\"chilli\",\"child-of-fiction-model\",\"sauce\"\n\"secret\",\"child-of-fiction-model\",\"sauce\"\n\"spoon-of\",\"child-of-fiction-model\",\"sauce\"\n\"meat-type\",\"child-of-fiction-model\",\"meat\"\n\"sauce\",\"child-of-fiction-model\",\"meat\"\n\"vegetable-mix\",\"child-of-fiction-model\",\"vegetable\"\n\"sauce\",\"child-of-fiction-model\",\"vegetable\"\n\"topping\",\"child-of-fiction-model\",\"dessert\"\n\"starter\",\"child-of-fiction-model\",\"meal\"\n\"main-meat\",\"child-of-fiction-model\",\"meal\"\n\"main-vegetable\",\"child-of-fiction-model\",\"meal\"\n\"dessert\",\"child-of-fiction-model\",\"meal\"\n\"a-vegetable-1-1\",\"vegetable-mix\",\"turnip\"\n\"a-vegetable-1-1\",\"vegetable-mix\",\"potato\"\n\"a-sauce-3-1\",\"pepper\",\"2\",\"teaspoon\"\n\"a-sauce-3-1\",\"diced-onion\",\"2\"\n\"a-sauce-3-1\",\"chilli\",\"false\"\n\"a-sauce-3-1\",\"secret\",\"ref-a-secret\"\n\"a-sauce-3-1\",\"spoon-of\",\"cognac\"\n\"a-sauce-3-1\",\"spoon-of\",\"armagnac\"\n\"a-vegetable-2-2\",\"vegetable-mix\",\"carrot\"\n\"a-vegetable-2-2\",\"sauce\",\"a-sauce-3-1\"\n\"ref-a-secret\",\"ingredient\",\"lemon\"\n\"ref-a-secret\",\"ingredient\",\"orange\"\n```\n\n### Generate JSON\n```\ncat LICENSE |  fict run '2 of `Vegetable`' recipe \"test/fixtures\" -o json -p beautiful\n```\nConcerning the optional parameter -p or --print:\n* machine: Format the output in a compact manner easily readable by a machine.\n* beautiful: Format the output in a beautiful manner.\n* outline: Format the output with the main outlines.\n\nWill output\n\n```\n[\n {\"i\": \"a-ingredient-4\",\n  \"s\": \"ingredient\",\n  \"p\": \"child-of-fiction-model\",\n  \"o\": [\n   \"secret-spice\"\n  ]\n },\n {\n  \"i\": \"a-olive-oil-5\",\n  \"s\": \"olive-oil\",\n  \"p\": \"child-of-fiction-model\",\n  \"o\": [\n   \"sauce\"\n  ]\n },\n {\n  \"i\": \"a-pepper-6\",\n  \"s\": \"pepper\",\n  \"p\": \"child-of-fiction-model\",\n  \"o\": [\n   \"sauce\"\n  ]\n },\n{\"i\":\"a-diced-onion-7\",\"s\":\"diced-onion\",\"p\":\"child-of-fiction-model\",\"o\":[\"sauce\"]},\n{\"i\":\"a-spice:Garlic/wild-8\",\"s\":\"spice:Garlic/wild\",\"p\":\"child-of-fiction-model\",\"o\":[\"sauce\"]},\n{\"i\":\"a-spice:Garlic/black-9\",\"s\":\"spice:Garlic/black\",\"p\":\"child-of-fiction-model\",\"o\":[\"sauce\"]},\n{\"i\":\"a-chilli-10\",\"s\":\"chilli\",\"p\":\"child-of-fiction-model\",\"o\":[\"sauce\"]},\n{\"i\":\"a-secret-11\",\"s\":\"secret\",\"p\":\"child-of-fiction-model\",\"o\":[\"sauce\"]},\n{\"i\":\"a-spoon-of-12\",\"s\":\"spoon-of\",\"p\":\"child-of-fiction-model\",\"o\":[\"sauce\"]},\n{\"i\":\"a-meat-type-13\",\"s\":\"meat-type\",\"p\":\"child-of-fiction-model\",\"o\":[\"meat\"]},\n{\"i\":\"a-sauce-14\",\"s\":\"sauce\",\"p\":\"child-of-fiction-model\",\"o\":[\"meat\"]},\n{\"i\":\"a-vegetable-mix-15\",\"s\":\"vegetable-mix\",\"p\":\"child-of-fiction-model\",\"o\":[\"vegetable\"]},\n{\"i\":\"a-sauce-16\",\"s\":\"sauce\",\"p\":\"child-of-fiction-model\",\"o\":[\"vegetable\"]},\n{\"i\":\"a-topping-17\",\"s\":\"topping\",\"p\":\"child-of-fiction-model\",\"o\":[\"dessert\"]},\n{\"i\":\"a-starter-18\",\"s\":\"starter\",\"p\":\"child-of-fiction-model\",\"o\":[\"meal\"]},\n{\"i\":\"a-main-meat-19\",\"s\":\"main-meat\",\"p\":\"child-of-fiction-model\",\"o\":[\"meal\"]},\n{\"i\":\"a-main-vegetable-20\",\"s\":\"main-vegetable\",\"p\":\"child-of-fiction-model\",\"o\":[\"meal\"]},\n{\"i\":\"a-dessert-21\",\"s\":\"dessert\",\"p\":\"child-of-fiction-model\",\"o\":[\"meal\"]},\n{\"s\":\"a-vegetable-1-1\",\"p\":\"vegetable-mix\",\"o\":[\"turnip\"]},\n{\"s\":\"a-vegetable-1-1\",\"p\":\"vegetable-mix\",\"o\":[\"potato\"]},\n{\"s\":\"a-sauce-3-1\",\"p\":\"pepper\",\"o\":[2,\"teaspoon\"]},\n{\"s\":\"a-sauce-3-1\",\"p\":\"diced-onion\",\"o\":[2]},\n{\"s\":\"a-sauce-3-1\",\"p\":\"chilli\",\"o\":[false]},\n{\"s\":\"a-sauce-3-1\",\"p\":\"secret\",\"o\":[\"ref-a-secret\"]},\n{\"s\":\"a-sauce-3-1\",\"p\":\"spoon-of\",\"o\":[\"cognac\"]},\n{\"s\":\"a-sauce-3-1\",\"p\":\"spoon-of\",\"o\":[\"armagnac\"]},\n{\"s\":\"a-vegetable-2-2\",\"p\":\"vegetable-mix\",\"o\":[\"carrot\"]},\n{\"s\":\"a-vegetable-2-2\",\"p\":\"sauce\",\"o\":[\"a-sauce-3-1\"]},\n{\"s\":\"ref-a-secret\",\"p\":\"ingredient\",\"o\":[\"lemon\"]},\n{\"s\":\"ref-a-secret\",\"p\":\"ingredient\",\"o\":[\"orange\"]}\n]\n```\n\n## Features of the fiction dialect\n\nThe fiction dialect supports the following features:\n * Import\n * Weighting\n * Frequency\n * Models and references\n * Lists\n * Mappings\n\n### Import\n\nThe fiction dialect allow a fiction script to reference another.\n\nExample:\n```\n## Import\n\n* another-script\n* more-script\n\n```\n\n### Weighting\n\nWeighting allows to introduce a bias to favor some values against others.\n\nExample of declaration:\n```\n## Weighting\n\n* ** experimental **  1,2,4,8,16\n```\n\n### Frequency\n\nThe frequency allows to decide how likely it is that an attribute will exist.\n\nExample of declaration:\n```\n## Frequency\n\n* **Never, Rarely, Occasionally, Sometimes, Often, Usually, Always** 0,1,2,3,4,5,6\n\n```\n\nExample of usage:\n```\n* **Diced onion** often ; *1,2,5*\n```\n\n### Models and references\n\nYou can represent subject-predicate-object relationships in the models section.\nThe subject is declared as a title while the predicate-objects are a list.\n\n\nExample:\n```\n## Models\n\n### Meat\n\n* **meat type** *pork,beef,chicken*\n* **sauce** usually; `sauce`\n\n```\n\nReferences are models that can be accessed by name.\n\n```\n## References\n\n* **secret** 2 of `Secret spice`\n```\n\n### Lists\n\nFiction scripts rely often on lists to generate fictional data.\nYou can create re-usable lists by declaring them in a list section.\n\nLists can be loaded from files or from local web services.\nThey can be stored as a JSON array or as a text with each row on a different line.\nAlternatively, the format mostly used by [corpora](https://github.com/dariusk/corpora) is also supported (see male-first-name.json).\nThe markdown syntax should be unaware of the exact location of the document.\n\nExample of list declaration:\n```\n## Lists\n\n* **male first name** `json-doc:male-first-name`\n```\n\nExample of use:\n```\n* **first name** `male first name`\n```\n\n### Mappings\n\nMappings are used to create short aliases.\nThey can be loaded from files or from local web services.\n\nThe markdown syntax should be unaware of the exact location of the document.\n\nExample of mapping declaration:\n```\n## Mappings\n\n* **title** `json-doc:title`\n```\n\nExample of use:\n```\n* **sex** *female*; `title:dr`\n```\n\nFor an internal representation of:\n```\n{\n\t\"dr\": [\"Doctor\",{\"fr\": \"Docteur\"}]\n}\n```\n\n\n## License\n\nMIT © [Olivier Huin]()\n\n\n[npm-url]: https://npmjs.org/package/dazzling-fiction\n[npm-image]: https://badge.fury.io/js/dazzling-fiction.svg\n[travis-url]: https://travis-ci.org/flarebyte/dazzling-fiction\n[travis-image]: https://travis-ci.org/flarebyte/dazzling-fiction.svg?branch=master\n[daviddm-url]: https://david-dm.org/flarebyte/dazzling-fiction.svg?theme=shields.io\n[daviddm-image]: https://david-dm.org/flarebyte/dazzling-fiction\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflarebyte%2Fdazzling-fiction","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflarebyte%2Fdazzling-fiction","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflarebyte%2Fdazzling-fiction/lists"}