{"id":18454614,"url":"https://github.com/battila7/downson-js-cli","last_synced_at":"2025-04-22T14:27:17.503Z","repository":{"id":57215729,"uuid":"144336180","full_name":"battila7/downson-js-cli","owner":"battila7","description":"A command-line downson-to-JSON converter.","archived":false,"fork":false,"pushed_at":"2018-08-25T20:54:46.000Z","size":21,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-16T20:47:06.684Z","etag":null,"topics":["cli","downson","markdwon"],"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/battila7.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}},"created_at":"2018-08-10T22:04:59.000Z","updated_at":"2023-02-13T19:30:35.000Z","dependencies_parsed_at":"2022-08-24T22:31:17.339Z","dependency_job_id":null,"html_url":"https://github.com/battila7/downson-js-cli","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/battila7%2Fdownson-js-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/battila7%2Fdownson-js-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/battila7%2Fdownson-js-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/battila7%2Fdownson-js-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/battila7","download_url":"https://codeload.github.com/battila7/downson-js-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249299158,"owners_count":21246782,"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":["cli","downson","markdwon"],"created_at":"2024-11-06T08:05:30.165Z","updated_at":"2025-04-22T14:27:17.484Z","avatar_url":"https://github.com/battila7.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Downson.js CLI\n\nA command-line downson-to-JSON converter built around the [downson.js](https://github.com/battila7/downson-js/) library.\n\nWhat's downson? It's the new configuration/data file format, y'all've been waiting for! :rocket: Check it out at here: [downson](https://github.com/battila7/downson/).\n\n## Installation\n\n~~~~bash\nnpm install -g downson-cli\n~~~~\n\n## Usage \n\nUsing `downson-cli` is pretty straightforward:\n\n~~~~\n$ downson-cli -o hello.json\n**.hello** [](right) [world!](string)\n^D\n$ cat hello.json\n{\"hello\":\"world!\"}\n~~~~\n\nThe list of supported command-line arguments is as follows:\n\n~~~~\nOptions:\n  --version     Show version number                                                               [boolean]\n  -i, --input   The input file to read from. If omitted, then stdin is used.                      [string]\n  -o, --output  The output file to write to. If omitted, then stdout is used.                     [string]\n  -p, --pretty  Pretty-print the result.                                                          [boolean]\n  -s, --silent  Ignore interpretation errors and fatal errors.                                    [boolean]\n  -t, --type    Path to a module that can register custom types. Can be specified multiple types. [string]\n  --help        Show help                                                                         [boolean]\n~~~~\n\n### Custom Types\n\nCustom types can be registered using modules passed using the `-t` (`-type`) parameter. \n\nRegistered modules should expose a single one-parameter function, which will be called with the `downson.registerType` function. A module can register an arbitrary number of custom types.\n\nAn example module is as follows:\n\n~~~~JavaScript\nmodule.exports = function (register) {\n    register('number', (type, value, parameters) =\u003e {\n        const radix = parameters.radix || 10;\n\n        try {\n            return {\n                value: Number.parseInt(value, radix)\n            };\n        } catch {\n            return {\n                error: `Could not parse ${value} as a base-${radix} number!`\n            };\n        }\n    });\n};\n~~~~\n\n### Exit Codes and Ouput\n\nIf the process was successful or the `--silent` option was set, then \n  * the exit code is set to `0`,\n  * the *data layer* of the downson document is written to either the `stdout` or the specified output file,\n  * the list of the failures is written to `stderr`.\n\nIf the process was successful but the downson library hit an interpretation error (and the `--silent` option is unset), then\n  * the exit code is set to `1`,\n  * the presumably corrupted *data layer* of the downson document is written to either the `stdout` or the specified output file,\n  * the list of the failures is written to `stderr`.\n\nIf downson-cli encounters a fatal error (and the `--silent` option is unset), then\n  * the exit code is set to `2`,\n  * the error is written to `stderr`,\n  * nothing is written to `stdout`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbattila7%2Fdownson-js-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbattila7%2Fdownson-js-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbattila7%2Fdownson-js-cli/lists"}