{"id":23162939,"url":"https://github.com/athrvk/calibre-node","last_synced_at":"2026-02-18T07:02:33.130Z","repository":{"id":267149150,"uuid":"897836794","full_name":"athrvk/calibre-node","owner":"athrvk","description":"A lightweight, high-performance Node.js ebook conversion library powered by Calibre, featuring built-in queue management and parallel processing capabilities.","archived":false,"fork":false,"pushed_at":"2024-12-15T15:35:27.000Z","size":342,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-28T05:28:45.173Z","etag":null,"topics":["calibre","convertor","ebook-convert","nodejs","pdf-to-epub"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/calibre-node","language":"TypeScript","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/athrvk.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,"zenodo":null}},"created_at":"2024-12-03T10:23:40.000Z","updated_at":"2024-12-15T15:35:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"ba5ccbc9-5567-45f2-b039-e5792c5efe02","html_url":"https://github.com/athrvk/calibre-node","commit_stats":null,"previous_names":["athrvk/calibre-node"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/athrvk/calibre-node","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/athrvk%2Fcalibre-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/athrvk%2Fcalibre-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/athrvk%2Fcalibre-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/athrvk%2Fcalibre-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/athrvk","download_url":"https://codeload.github.com/athrvk/calibre-node/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/athrvk%2Fcalibre-node/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29571888,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T06:19:27.422Z","status":"ssl_error","status_checked_at":"2026-02-18T06:18:44.348Z","response_time":162,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["calibre","convertor","ebook-convert","nodejs","pdf-to-epub"],"created_at":"2024-12-18T00:14:25.756Z","updated_at":"2026-02-18T07:02:33.121Z","avatar_url":"https://github.com/athrvk.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# calibre-node\n\n[![NPM Version](https://img.shields.io/npm/v/calibre-node)](https://www.npmjs.com/package/calibre-node) ![NPM Downloads](https://img.shields.io/npm/dy/calibre-node) \n\ncalibre-node is a lightweight Node.js module that provides ebook conversion capabilities by wrapping the Calibre CLI tools. It offers built-in queuing and threading to efficiently handle multiple conversions with ease. Please note that this module does not handle the actual conversion algorithms; it interfaces with Calibre's CLI utilities to perform conversions.\n\n## Installation\n\nFirst, ensure that you have Calibre installed on your system, as this module relies on its conversion tools. You can download Calibre from the [official website](https://calibre-ebook.com/download_linux). Make sure that the `ebook-convert` command is available in your system's PATH.\n\nTo test if Calibre is installed correctly, run the following command in your terminal:\n\n```bash\nebook-convert --version\n```\n\nTo install calibre-node, use npm:\n\n```bash\nnpm install calibre-node\n```\n\n### Installing Calibre\n\nThe package includes a CLI tool to help install Calibre:\n\n```bash\nnpx calibre-node install calibre\n```\n\nWhen installing Calibre using the CLI tool, you can specify additional options:\n\n- `--install_dir=*path/to/install*`: The directory where Calibre will be installed. The default is `./calibre-bin` (root of the project).\n\nExample usage:\n\n```bash\nnpx calibre-node install calibre --install_dir=/custom/path/to/calibre\n```\n\n## Usage\n\nAfter installing both Calibre and calibre-node, you can start converting ebooks in your Node.js application.\n\n```javascript\nconst calibre = require('calibre-node');\n\n// Convert an ebook\ncalibre.convert({\n    input: './input/book.pdf',\n    output: './output/book.epub',\n    delete: false,\n    silent: true, // this package's console output\n    verbose: 'low' // calibre conversion output verbosity\n}).then(response =\u003e {\n    console.log('Conversion successful:', response);\n}).catch(error =\u003e {\n    console.error('Conversion failed:', error);\n});\n```\n\nIn this example, a PDF file at `./input/book.pdf` is converted to an EPUB file at `./output/book.epub`. Set the `delete` option to `true` if you want to remove the input file after conversion, and `silent` to `false` if you want verbose logging.\n\n### Conversion Options\n\nThe `convert` function accepts an object with the following properties:\n\n- `input` (string, required): The path to the input file.\n- `output` (string, required): The path where the output file will be saved, including the desired extension.\n- `delete` (boolean, optional): Whether to delete the input file after conversion. Default is `false`.\n- `silent` (boolean, optional): If set to `true`, suppresses calibre-node package's console output. Default is `true`.\n- `verbose` (\"low\" | \"med\" | \"high\", optional): Sets the verbosity level of calibre conversion output. Default is `\"low\"`.\n\nAdditional conversion options supported by Calibre can also be included. Refer to the [Calibre conversion documentation](https://manual.calibre-ebook.com/generated/en/ebook-convert.html) for a full list of parameters.\n\n### Conversion Result\n\nThe conversion promise resolves with a result object containing:\n\n- `success` (boolean): Indicates whether the conversion was successful\n- `filePath` (string): The full path where the converted file was saved\n- `filename` (string): The name of the converted file without extension\n- `extension` (string): The file extension of the converted file\n- `error` (string, optional): Error message if the conversion failed\n\n```typescript\ninterface ConversionResult {\n    success: boolean;\n    filePath: string;\n    filename: string;\n    extension: string;\n    error?: string;\n}\n```\n\n### Managing the Thread Pool\n\nYou can control the number of concurrent conversions by setting the thread pool size:\n\n```javascript\ncalibre.setPoolSize(2); // Allows two conversions to run simultaneously, Default is 1\n```\n\nConversions exceeding the pool size will be queued and processed when threads become available.\n\n### Set Calibre Path\n\nIf the `ebook-convert` command is not in your system's PATH, you can specify the full path to the Calibre CLI tools:\n\n```javascript\ncalibre.setCalibrePath('/path/to/calibre');\n```\n\n## Contributing\n\nThis module is open-source under the MIT license. Contributions, issues, and feature requests are welcome! Feel free to fork and submit pull requests.\n\n## Credits\n\ncalibre-node is an improvement over the [node-ebook-converter](https://www.npmjs.com/package/node-ebook-converter) package.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fathrvk%2Fcalibre-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fathrvk%2Fcalibre-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fathrvk%2Fcalibre-node/lists"}