npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

breakdance-mercury

v1.0.1

Published

Breakdance plugin for mercury, the spiritual successor to readability.com. Mercury removes ads and distractions from HTML before passing it to breakdance, resulting in cleaner, more readable markdown.

Downloads

12

Readme

breakdance-mercury NPM version NPM monthly downloads NPM total downloads Linux Build Status

Breakdance plugin for mercury, the spiritual successor to readability.com. Mercury removes ads and distractions from HTML before passing it to breakdance, resulting in cleaner, more readable markdown.

Install

Install with npm:

$ npm install --save breakdance-mercury

Usage

Add breakdance-mercury to your node.js application with the following line of JavaScript:

var mercury = require('breakdance-mercury');

API

mercury

The main export is a function that takes a url and options, and returns a promise. See breakdance for documentation and all available options.

Params

  • url {String}: The url of the HTML file to convert to markdown using breakdance
  • options {Object}: Options to pass to breakdance
  • returns {Promise}

Example

mercury('http://breakdance.io/plugins.html')
  .then(function(res) {
    console.log(res.markdown);
  });

.reduce

Convert multiple HTML files to markdown by passing a base url and an array of paths.

Params

  • url {String}: The base url to use.
  • paths {String}: One or more paths to concatenate to the base url.
  • options {Object}: Options to pass to breakdance
  • returns {Promise}

Example

mercury.reduce('http://breakdance.io/', ['docs.html', 'plugins.html'])
  .then(function(urls) {
    urls.forEach((res) => console.log(res.md));
  });

CLI

Installing the CLI

$ npm install  --global breakdance-mercury

This adds the bdm command to your system path, allowing you to run breakdance-mercury CLI from any directory:

$ bdm [options] <src> <dest>
# or use the "breakdance-mercury" alias in case of conflicts
$ breakdance-mercury [options] <src> <dest>

CLI examples

Get http://breakdance.io/plugins.html and convert it to markdown with breakdance, then write it to plugins.md.

$ bdm http://breakdance.io/plugins.html
# or using flags
$ bdm -s http://breakdance.io/plugins.html -d foo.md
# "pick" just the ".main-content" section from the page
$ bdm -s http://breakdance.io/plugins.html -d foo.md -p ".main-content"

CLI options

Usage: $ bdm [options] <src> <dest>

   src:  The URL of the source file to convert to markdown
  dest:  Name of the markdown destination file to create.
         By default the HTML filename is used with a .md
         extension.

Options:

  -h, --help     Show this help menu in the terminal
  -s, --src      Show this help menu in the terminal
  -c, --condense Collapse more than two newlines to only
                 two newlines. Enabled by default
  -d, --dest     The destination filepath to use.
  -o, --omit     One or more tags to omit entirely from
                 the HTML before converting to markdown.
  -p, --pick     One or more tags to pick entirely from the
                 HTML before converting to markdown.
  --comments     Include HTML code comments in the generated
                 markdown string. Disabled by default

About

Related projects

You might also be interested in these projects:

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Please read the contributing guide for advice on opening issues, pull requests, and coding standards.

Building docs

(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)

To generate the readme, run the following command:

$ npm install -g verbose/verb#dev verb-generate-readme && verb

Running tests

Running 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:

$ npm install && npm test

Author

Jon Schlinkert

License

Copyright © 2017, Jon Schlinkert. Released under the MIT License.


This file was generated by verb-generate-readme, v0.6.0, on August 12, 2017.