{"id":19500571,"url":"https://github.com/naturalintelligence/text2obj","last_synced_at":"2026-02-11T03:32:49.114Z","repository":{"id":253531204,"uuid":"843712796","full_name":"NaturalIntelligence/text2obj","owner":"NaturalIntelligence","description":"WIP","archived":false,"fork":false,"pushed_at":"2024-11-09T03:01:50.000Z","size":107,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-06T18:49:43.452Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/NaturalIntelligence.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":"2024-08-17T07:28:33.000Z","updated_at":"2024-11-13T10:06:21.000Z","dependencies_parsed_at":"2024-11-04T06:28:04.183Z","dependency_job_id":"8ff59c16-072b-4fe1-8594-828d2a1ef83a","html_url":"https://github.com/NaturalIntelligence/text2obj","commit_stats":null,"previous_names":["naturalintelligence/algoflow","naturalintelligence/slimo","naturalintelligence/text2obj"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/NaturalIntelligence/text2obj","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NaturalIntelligence%2Ftext2obj","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NaturalIntelligence%2Ftext2obj/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NaturalIntelligence%2Ftext2obj/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NaturalIntelligence%2Ftext2obj/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NaturalIntelligence","download_url":"https://codeload.github.com/NaturalIntelligence/text2obj/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NaturalIntelligence%2Ftext2obj/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29326182,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T02:08:56.257Z","status":"ssl_error","status_checked_at":"2026-02-11T02:08:51.338Z","response_time":97,"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-11-10T22:08:56.672Z","updated_at":"2026-02-11T03:32:49.101Z","avatar_url":"https://github.com/NaturalIntelligence.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# text2obj\nWith due respect to all the text to diagram generators, the aim of this library is to parse text given in expected format and generate an intermediate object that can be used to draw diagrams or use in some kind of automation.\n\nCurrently, this library supports parsing algorithm(or flow) to generate flow chart.\n\nSample Flow\n```\nFLOW: Sample flow 1\nversion:  1.0\nthreshold: 6000\nLOOP (source is) readable\n  THEN read a character (of input buffer)\n  IF statement \n    IF another statement\n      THEN found here\n      AND copy data\n    ELSE_IF parallel statement\n      DO nothing\n      ERR Unexpected end of input\n      END\n    ELSE last statement\n  ELSE something\n  IF optional\nDO in end\n```\n\n```js\nconst parse = require(\"@solothought/text2obj/flow\")\n\nconst flows = parse(flowText);\nflows['Sample flow 1];\n```\nOutput\n```\n\n[\n  {\n    \"name\": \"Sample flow 1\",\n    \"headers\": {\n      \"version\": \"1.0\",\n      \"threshold\": \"6000\"\n    },\n    \"steps\": [\n      { \"msg\": \"readable\", \"rawMsg\": \"(source is) readable\", \"type\": \"LOOP\", \"indent\": 0  },\n      {\n        \"msg\": \"read a character\",\n        \"rawMsg\": \"read a character (of input buffer)\",\n        \"type\": \"THEN\",\n        \"indent\": 1\n      },\n      { \"msg\": \"statement\", \"rawMsg\": \"statement\", \"type\": \"IF\", \"indent\": 1  },\n      { \"msg\": \"another statement\", \"rawMsg\": \"another statement\", \"type\": \"IF\", \"indent\": 2  },\n      { \"msg\": \"found here\", \"rawMsg\": \"found here\", \"type\": \"THEN\", \"indent\": 3  },\n      { \"msg\": \"copy data\", \"rawMsg\": \"copy data\", \"type\": \"AND\", \"indent\": 3  },\n      { \"msg\": \"parallel statement\", \"rawMsg\": \"parallel statement\", \"type\": \"ELSE_IF\", \"indent\": 2  },\n      { \"msg\": \"DO nothing\", \"rawMsg\": \"DO nothing\", \"type\": \"\", \"indent\": 3  },\n      {\n        \"msg\": \"Unexpected end of input\",\n        \"rawMsg\": \"Unexpected end of input\",\n        \"type\": \"ERR\",\n        \"indent\": 3\n      },\n      { \"msg\": \"\", \"rawMsg\": \"\", \"type\": \"END\", \"indent\": 3  },\n      { \"msg\": \"last statement\", \"rawMsg\": \"last statement\", \"type\": \"ELSE\", \"indent\": 2  },\n      { \"msg\": \"something\", \"rawMsg\": \"something\", \"type\": \"ELSE\", \"indent\": 1  },\n      { \"msg\": \"optional\", \"rawMsg\": \"optional\", \"type\": \"IF\", \"indent\": 1  },\n      { \"msg\": \"DO in end\", \"rawMsg\": \"DO in end\", \"type\": \"\", \"indent\":       }\n    ],\n    \"links\": {\n      \"0\":  [ 1, 13 ],\n      \"1\":  [ 2 ],\n      \"2\":  [ 3, 12 ],\n      \"3\":  [ 4, 6 ],\n      \"4\":  [ 5 ],\n      \"5\":  [ 10 ],\n      \"6\":  [ 7, 11 ],\n      \"7\":  [ 8 ],\n      \"8\":  [-1 ],\n      \"12\": [ null, 0 ],\n      \"13\": [-1 ]\n    },\n    \"leveledSteps\": [[0,13],[1,2,11,12],[3,6,10],[4,5,7,8,9]]\n  }\n]\n```\n\n- `-1` means end\n- `links` represents linking among steps.\n- `leveledSteps` are steps on different indentation. ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaturalintelligence%2Ftext2obj","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnaturalintelligence%2Ftext2obj","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaturalintelligence%2Ftext2obj/lists"}