{"id":22025878,"url":"https://github.com/digitallinguistics/toolbox2json","last_synced_at":"2026-05-07T01:09:52.325Z","repository":{"id":48783626,"uuid":"342063996","full_name":"digitallinguistics/toolbox2json","owner":"digitallinguistics","description":"A Node (JavaScript) library to convert SIL Toolbox dictionary files to JSON","archived":false,"fork":false,"pushed_at":"2023-07-19T01:33:37.000Z","size":93,"stargazers_count":2,"open_issues_count":6,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-04-14T11:04:27.977Z","etag":null,"topics":["dictionaries","dictionary","json","language","languages","lexicography","linguistics","toolbox"],"latest_commit_sha":null,"homepage":"https://developer.digitallinguistics.io/toolbox2json","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/digitallinguistics.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}},"created_at":"2021-02-24T23:26:07.000Z","updated_at":"2021-07-12T11:11:19.000Z","dependencies_parsed_at":"2022-08-31T05:40:44.287Z","dependency_job_id":"33a11e73-5c97-4eff-90ae-d24defcfb2c0","html_url":"https://github.com/digitallinguistics/toolbox2json","commit_stats":{"total_commits":47,"total_committers":2,"mean_commits":23.5,"dds":"0.021276595744680882","last_synced_commit":"797ece276a06e644388bd3ff4220b2bcf6c95cc1"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitallinguistics%2Ftoolbox2json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitallinguistics%2Ftoolbox2json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitallinguistics%2Ftoolbox2json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitallinguistics%2Ftoolbox2json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/digitallinguistics","download_url":"https://codeload.github.com/digitallinguistics/toolbox2json/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245090876,"owners_count":20559298,"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":["dictionaries","dictionary","json","language","languages","lexicography","linguistics","toolbox"],"created_at":"2024-11-30T07:20:17.142Z","updated_at":"2025-09-18T00:49:24.244Z","avatar_url":"https://github.com/digitallinguistics.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# toolbox2json\n\nA Node / JavaScript library for parsing [SIL][SIL] [Toolbox][Toolbox] dictionary files and optionally converting them to [JSON][JSON]. Useful for any linguist working with a Toolbox dictionary database. Runs as a module or on the command line.\n\nIf you use this library for research purposes, please consider citing it using the following model:\n\n\u003e Hieber, Daniel W. 2021. @digitallinguistics/toolbox2json. DOI:10.5281/zenodo.4560920.\n\n[![GitHub release (latest by date)](https://img.shields.io/github/v/release/digitallinguistics/toolbox2json)][releases]\n[![tests status](https://github.com/digitallinguistics/toolbox2json/actions/workflows/test.yml/badge.svg?branch=main)][status]\n[![GitHub issues](https://img.shields.io/github/issues/digitallinguistics/toolbox2json)][issues]\n[![DOI](https://zenodo.org/badge/342063996.svg)](https://zenodo.org/badge/latestdoi/342063996)\n[![license](https://img.shields.io/github/license/digitallinguistics/toolbox2json)][license]\n[![GitHub repo stars](https://img.shields.io/github/stars/digitallinguistics/toolbox2json?style=social)][GitHub]\n\n## Contents\n\u003c!-- TOC --\u003e\n- [Prerequisites](#prerequisites)\n- [Basic Usage](#basic-usage)\n  - [Running as a Module](#running-as-a-module)\n  - [Running on the Command Line](#running-on-the-command-line)\n- [Field Mappings](#field-mappings)\n- [Options](#options)\n- [Contributing](#contributing)\n\u003c!-- /TOC --\u003e\n\n## Prerequisites\n\n* Basic knowledge of JavaScript OR knowledge of how to run a program from the command line.\n* [Node.js][Node] installed on your system.\n\n## Basic Usage\n\nInstall using [npm][npm] or [yarn][yarn]. (npm comes bundled with Node.js when you install it.)\n\n```cmd\nnpm install @digitallinguistics/toolbox2json\nyarn add @digitallinguistics/toolbox2json\n```\n\nThe library can be run as either a JavaScript module or from the command line.\n\n### Running as a Module\n\nThe JavaScript module exports a single function, `toolbox2json`, which accepts two arguments:\n\n* the path to the Toolbox file (_required_)\n* an options object (_optional_)\n\nBy default, the library returns a Promise that resolves to an Array of the entries in the Toolbox file.\n\n```js\nimport convert from '@digitallinguistics/toolbox2json';\n\nconst entries = await convert(`./my-data.db`);\n```\n\nYou can also save the data to a JSON file by providing the `out` option:\n\n```js\nimport convert from '@digitallinguistics/toolbox2json';\n\nawait convert(`./my-data.db`, { out: `my-data.json` });\n```\n\n### Running on the Command Line\n\nTo run the library from the command line, use `toolbox2json \u003cfilePath\u003e`. (The `toolbox2json` command is added to the PATH when the library is installed.) This will print the results to the console by default. To save the JSON output to a file, use the `--out` option or `-o` flag: `toolbox2json \u003cfilePath\u003e --out \u003cjsonPath\u003e`. To see the full list of command line options, run `toolbox2json --help`.\n\n## Field Mappings\n\nThe library will use line markers as property names when converting data. For example, if the Toolbox file has a field `\\txn` for transcriptions, that would be converted to `{ \"txn\": \"\u003cdata\u003e\" }`.\n\nIf the Toolbox entry contains multiple instances of the same line marker, they will be converted to an array by default. For example, if the Toolbox file has two `\\gl` fields containing the data `fire` and `light`, those would be converted to `{ \"gl\": [\"fire\", \"light\"] }`.\n\n## Options\n\n| Module       | Command Line    | Flag | Type             | Default  | Description                                                                                                                                                                                                                                                          |\n|--------------|-----------------|------|------------------|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n|              | `--help`        | `-h` |                  |          | Display help.                                                                                                                                                                                                                                                        |\n| `parseError` | `--parse-error` | `-e` | String           | `\"warn\"` | How to handle errors when parsing records. `\"error\"`: Stop and throw an error. `\"none\"`: Fail silently and continue. No object is created for that entry. `\"object\"`: Return a ParseError object for that entry. `\"warn\"`: Throw a warning and continue (_default_). |\n| `ndjson`     | `--ndjson`      | `-n` | Boolean          | `false`  | Outputs newline-delimited JSON.                                                                                                                                                                                                                                      |\n| `out`        | `--out`         | `-o` | String           |          | The path where the JSON file should be saved. If this option is provided, the module will return a Promise that resolves when the operation is complete, and no JSON data will be displayed on the command line.                                                     |\n| `pretty`     | `--pretty`      | `-p` | Integer / String | `false`  | Whether to pretty-print the JSON input. The value of this option is passed as the third argument to `JSON.stringify()`. If a value is provided for this option, the `ndjson` option will be set to `false`.                                                          |\n| `silent`     | `--silent`      | `-s` | Boolean          | `false`  | Silence console output.                                                                                                                                                                                                                                              |\n|              | `--version`     | `-v` |                  |          | Output the version number.                                                                                                                                                                                                                                           |\n\n## Contributing\n\n* Find a bug? Want to request a feature? [Open an issue.][new-issue]\n* Pull requests are welcome!\n* Tests are run using [Mocha][Mocha] and [Chai][Chai]. You can run them locally with `npm test`.\n* Sample data for testing are located in `/test`.\n\n\u003c!-- LINKS --\u003e\n[Chai]:      https://www.chaijs.com/\n[GitHub]:    https://github.com/digitallinguistics/toolbox2json#readme\n[issues]:    https://github.com/digitallinguistics/toolbox2json/issues\n[JSON]:      https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/JSON\n[license]:   https://github.com/digitallinguistics/toolbox2json/blob/main/LICENSE\n[Mocha]:     https://mochajs.org/\n[new-issue]: https://github.com/digitallinguistics/toolbox2json/issues/new\n[Node]:      https://nodejs.org/\n[npm]:       https://www.npmjs.com/\n[releases]:  https://github.com/digitallinguistics/toolbox2json/releases\n[SIL]:       https://www.sil.org/\n[status]:    https://github.com/digitallinguistics/toolbox2json/actions/workflows/test.yml\n[Toolbox]:   https://software.sil.org/toolbox/\n[yarn]:      https://yarnpkg.com/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitallinguistics%2Ftoolbox2json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdigitallinguistics%2Ftoolbox2json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitallinguistics%2Ftoolbox2json/lists"}