{"id":13681852,"url":"https://github.com/breakdance/breakdance-request","last_synced_at":"2025-10-23T07:30:52.247Z","repository":{"id":57190383,"uuid":"100084689","full_name":"breakdance/breakdance-request","owner":"breakdance","description":"Convert webpages to markdown! API and CLI.","archived":false,"fork":false,"pushed_at":"2017-08-13T20:38:28.000Z","size":54,"stargazers_count":13,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-15T20:17:32.230Z","etag":null,"topics":["breakdance","breakdanceplugin","convert","converter","html","html-to-markdown","markdown","markup","md","plain-text","plugin","request","url","webpage"],"latest_commit_sha":null,"homepage":"http://breakdance.io","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/breakdance.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/contributing.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-12T02:49:11.000Z","updated_at":"2024-05-30T00:28:46.000Z","dependencies_parsed_at":"2022-08-27T10:41:20.346Z","dependency_job_id":null,"html_url":"https://github.com/breakdance/breakdance-request","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/breakdance%2Fbreakdance-request","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/breakdance%2Fbreakdance-request/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/breakdance%2Fbreakdance-request/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/breakdance%2Fbreakdance-request/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/breakdance","download_url":"https://codeload.github.com/breakdance/breakdance-request/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237793944,"owners_count":19367422,"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":["breakdance","breakdanceplugin","convert","converter","html","html-to-markdown","markdown","markup","md","plain-text","plugin","request","url","webpage"],"created_at":"2024-08-02T13:01:36.903Z","updated_at":"2025-10-23T07:30:46.982Z","avatar_url":"https://github.com/breakdance.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# breakdance-request [![NPM version](https://img.shields.io/npm/v/breakdance-request.svg?style=flat)](https://www.npmjs.com/package/breakdance-request) [![NPM monthly downloads](https://img.shields.io/npm/dm/breakdance-request.svg?style=flat)](https://npmjs.org/package/breakdance-request) [![NPM total downloads](https://img.shields.io/npm/dt/breakdance-request.svg?style=flat)](https://npmjs.org/package/breakdance-request) [![Linux Build Status](https://img.shields.io/travis/breakdance/breakdance-request.svg?style=flat\u0026label=Travis)](https://travis-ci.org/breakdance/breakdance-request)\n\n\u003e Get a webpage from a URL and convert it to markdown.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save breakdance-request\n```\n\n## Usage\n\nAdd `breakdance-request` to your node.js application with the following line of JavaScript:\n\n```js\nvar request = require('breakdance-request');\n```\n\n## API\n\n### [request](index.js#L28)\n\nThe main export is a function that takes a `url` and `options`, and returns a promise. See [breakdance](http://breakdance.io) for documentation and all available options.\n\n**Params**\n\n* `url` **{String}**: The url of the HTML file to convert to markdown using [breakdance](http://breakdance.io)\n* `options` **{Object}**: Options to pass to [breakdance](http://breakdance.io)\n* `returns` **{Promise}**\n\n**Example**\n\n```js\nrequest('http://breakdance.io/plugins.html')\n  .then(function(res) {\n    console.log(res.markdown);\n  });\n```\n\n### [.reduce](index.js#L77)\n\nConvert multiple HTML files to markdown by passing a base `url` and an array of `paths`.\n\n**Params**\n\n* `url` **{String}**: The base url to use.\n* `paths` **{String}**: One or more paths to concatenate to the base `url`.\n* `options` **{Object}**: Options to pass to [breakdance](http://breakdance.io)\n* `returns` **{Promise}**\n\n**Example**\n\n```js\nrequest.reduce('http://breakdance.io/', ['docs.html', 'plugins.html'])\n  .then(function(urls) {\n    urls.forEach((res) =\u003e console.log(res.md));\n  });\n```\n\n## CLI\n\n### Installing the CLI\n\n```sh\n$ npm install  --global breakdance-request\n```\n\nThis adds the `bdr` command to your system path, allowing you to run breakdance-request CLI from any directory:\n\n```sh\n$ bdr\n# or use the \"breakdance-request\" alias in case of conflicts\n$ breakdance-request\n```\n\n### CLI examples\n\nGet `http://breakdance.io/plugins.html` and convert it to markdown with [breakdance](http://breakdance.io), then write it to `plugins.md`.\n\n```sh\n$ bdr http://breakdance.io/plugins.html\n# or using flags\n$ bdr -s http://breakdance.io/plugins.html -d foo.md\n# \"pick\" just the \".main-content\" section from the page\n$ bdr -s http://breakdance.io/plugins.html -d foo.md -p \".main-content\"\n```\n\n### CLI options\n\n```\nUsage: $ bdr [options] \u003csrc\u003e \u003cdest\u003e\n\n   src:  The URL of the source file to convert to markdown\n  dest:  Name of the markdown destination file to create.\n         By default the HTML filename is used with a .md\n         extension.\n\nOptions:\n\n  -h, --help     Show this help menu in the terminal\n  -s, --src      Show this help menu in the terminal\n  -c, --condense Collapse more than two newlines to only\n                 two newlines. Enabled by default\n  -d, --dest     The destination filepath to use.\n  -o, --omit     One or more tags to omit entirely from\n                 the HTML before converting to markdown.\n  -p, --pick     One or more tags to pick entirely from the\n                 HTML before converting to markdown.\n  --comments     Include HTML code comments in the generated\n                 markdown string. Disabled by default\n\n```\n\n## About\n\n### Related projects\n\nYou might also be interested in these projects:\n\n* [breakdance-cli](https://www.npmjs.com/package/breakdance-cli): CLI for breakdance, the HTML to markdown converter for node.js. | [homepage](https://github.com/breakdance/breakdance-cli \"CLI for breakdance, the HTML to markdown converter for node.js.\")\n* [breakdance-reflinks](https://www.npmjs.com/package/breakdance-reflinks): Breakdance plugin that aggregates the urls from hrefs and src attributes at the bottom of… [more](https://github.com/breakdance/breakdance-reflinks) | [homepage](https://github.com/breakdance/breakdance-reflinks \"Breakdance plugin that aggregates the urls from hrefs and src attributes at the bottom of the file as reference links.\")\n* [breakdance](https://www.npmjs.com/package/breakdance): Breakdance is a node.js library for converting HTML to markdown. Highly pluggable, flexible and easy… [more](http://breakdance.io) | [homepage](http://breakdance.io \"Breakdance is a node.js library for converting HTML to markdown. Highly pluggable, flexible and easy to use. It's time for your markup to get down.\")\n\n### Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\nPlease read the [contributing guide](.github/contributing.md) for advice on opening issues, pull requests, and coding standards.\n\n### Building docs\n\n_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme \u0026\u0026 verb\n```\n\n### Running tests\n\nRunning and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:\n\n```sh\n$ npm install \u0026\u0026 npm test\n```\n\n### Author\n\n**Jon Schlinkert**\n\n* [github/jonschlinkert](https://github.com/jonschlinkert)\n* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)\n\n### License\n\nCopyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on August 13, 2017._","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbreakdance%2Fbreakdance-request","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbreakdance%2Fbreakdance-request","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbreakdance%2Fbreakdance-request/lists"}