# metanol

> Scrapes html metadata. MetaData html scraper and parser for Node.js

Latest version **0.4.1** (published 2017-08-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install metanol
pnpm add metanol
yarn add metanol
bun add metanol
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.1 |
| Published | 2017-08-05 |
| First published | 2016-11-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.12 |
| Dependencies | 4 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Ivanov Nikita |
| Maintainers | robotomize |
| Keywords | meta, metadata, scrape, tags, fetch, parsing, html, meta tags |

## Links

- npm: https://www.npmjs.com/package/metanol
- Repository: https://github.com/robotomize/metanol
- Homepage: https://github.com/robotomize/metanol.git/#readme
- Issues: https://github.com/robotomize/metanol/issues
- npm.io page: https://npm.io/package/metanol

## Dependencies (4)

- [cheerio](https://npm.io/package/cheerio.md) ^0.20.0
- [request](https://npm.io/package/request.md) ^2.81.0
- [remove-words](https://npm.io/package/remove-words.md) ^0.2.0
- [validate.io-uri](https://npm.io/package/validate.io-uri.md) ^1.0.0

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 0.4.1 (latest) — 2017-08-05
- 0.4.0 — 2017-08-05
- 0.3.0 — 2016-12-14
- 0.2.0 — 2016-12-08
- 0.1.5 — 2016-12-03
- 0.1.4 — 2016-12-03
- 0.1.3 — 2016-12-03
- 0.1.2 — 2016-11-30

## README

# Metanol - package to parse meta tags

### Using parseAll to get all the metadata.

[![Latest Stable Version](https://img.shields.io/npm/v/metanol.svg?style=flat-square)](https://www.npmjs.com/package/metanol)
[![License](https://img.shields.io/npm/l/metanol.svg?style=flat-square)](https://www.npmjs.com/package/metanol)
[![NPM Downloads](https://img.shields.io/npm/dt/metanol.svg?style=flat-square)](https://www.npmjs.com/package/metanol)
[![NPM Downloads](https://img.shields.io/npm/dm/metanol.svg?style=flat-square)](https://www.npmjs.com/package/metanol)

[![NPM](https://nodei.co/npm/metanol.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/metanol/)  


### Install 

``` 
npm i metanol 
```

### Usage

For example, let's get meta-tags with articles from techcrunch.com

```js
var metanol = require('metanol');
```
or es2017

```js
import metanol from 'metanol';

```
```js
metanol.parseAll('https://techcrunch.com/2016/11/27/disrupting-the-world-of-science-publishing/').then(resolver => {
    console.log(resolver);
}, err => {
    console.error(err);
});
```
```js

/**
 * Fetching main meta tags
 */
metanol.parseMain('https://techcrunch.com/2016/11/27/disrupting-the-world-of-science-publishing/').then(resolver => {
    console.log(resolver);
}, err => {
    console.error(err);
});

```

```js

/**
 * Fetching main meta tags from html
 */
let html = '<html><head><meta name="description" content="example description"></head></html>';

metanol.parseAll(null, html).then(resolver => {
    console.log(resolver);
}, err => {
    console.error(err);
});

/**
 * Fetching main meta tags from html
 */
metanol.parseAll(null, html).then(resolver => {
    console.log(resolver);
}, err => {
    console.error(err);
});
```


### Output

```js
{ _title: 'Disrupting the world of science publishing  |  TechCrunch',
  _description: 'Every scientist wants their paper to appear in Cell, Nature or Science. Being associated with such publications is synonymous with prestige and excellence...',
  _author: 'Bérénice Magistretti',
  _tags: [ 'disrupting', 'world', 'science', 'publishing', 'techcrunch' ],
  h1: 'Disrupting the world of science publishing',
  _og: 
   { url: 'http://social.techcrunch.com/2016/11/27/disrupting-the-world-of-science-publishing/',
     type: 'article',
     title: 'Disrupting the world of science publishing',
     image: 'https://tctechcrunch2011.files.wordpress.com/2016/11/sciencebook.jpg?w=764&h=400&crop=1',
     site_name: 'TechCrunch',
     description: 'Every scientist wants their paper to appear in Cell, Nature or Science. Being associated with such publications is synonymous with prestige and excellence...',
     website: '',
     profile: { first_name: '', last_name: '', username: '', gender: '' },
     book: { author: '', isbn: '', release_date: '', tag: '' },
     article: 
      { published_time: '',
        modified_time: '',
        expiration_time: '',
        author: '',
        section: '',
        tag: '' },
     video: '',
     video_type: '',
     audio: '',
     audio_type: '',
     price_amount: '',
     price_currency: '' },
  _itemProp: { name: '', description: '', image: '' },
  article: { tag: '', section: '', published_time: '', modified_time: '' },
  _twitter: 
   { card: 'summary_large_image',
     site: '@techcrunch',
     title: 'Disrupting the world of science publishing | TechCrunch',
     image: '',
     creator: '',
     description: 'Every scientist wants their paper to appear in Cell, Nature or Science. Being associated with such publications is synonymous with prestige and excellence. However, these journals are typically…' },
  _image: 'https://tctechcrunch2011.files.wordpress.com/2016/11/sciencebook.jpg?w=764&h=400&crop=1',
  _swiftType: 
   { title: 'Disrupting the world of science publishing',
     author: 'Bérénice Magistretti',
     object_type: 'post',
     url: 'https://techcrunch.com/2016/11/27/disrupting-the-world-of-science-publishing/',
     timestamp: '2016-11-27 10:00:57',
     content: 'Every scientist wants his or her paper to appear in Cell, Nature or Science. In today’s scientific world, being associated with such publications is synonymous with prestige and excellence, opening doors to top positions and coveted awards. Nonetheless, these journals are typically known to have an acceptance rate of 5-10 percent, meaning that the other 90-95 percent whose papers have been rejected are forced to find other publishing outlets that simply don’t have the same alluring impact within the academic world. ScienceMatters, a Swiss startup that launched in February, is trying to pave the way to a more democratized system by offering an open-source publishing platform to every scientist who wants to share his or her observations. “We are trying to publish the same way top science publications published 50 years ago,” explains Lawrence Rajendran, founder and CEO of ScienceMatters. “They used to publish exact observations, but now, competition for space is extremely…',
     excerpt: 'Every scientist wants their paper to appear in Cell, Nature or Science. Being associated with such publications is synonymous with prestige and excellence. However, these journals are typically known to have an acceptance rate of 5-10 percent. ScienceMatters is trying to pave the way to a more democratized system by offering an open-source publishing platform for scientists to share their work.',
     image: 'https://tctechcrunch2011.files.wordpress.com/2016/11/sciencebook.jpg?w=150',
     tag: 
      [ 'ScienceMatters',
        'scientific publishing',
        'Lawrence Rajendran',
        'open-source publishing' ] },
  _facebook: { app_id: '187288694643718' },
  _al: 
   { ios_url: '',
     ios_app_store_id: '',
     ios_app_name: '',
     android_url: '',
     android_package: '',
     android_app_name: '',
     windows_phone_app_name: '',
     windows_phone_app_id: '',
     windows_phone_app_url: '' } }

 MetaTags {
 _title: 'Disrupting the world of science publishing  |  TechCrunch',
 _description: 'Every scientist wants their paper to appear in Cell, Nature or Science. Being associated with such publications is synonymous with prestige and excellence...',
 _author: 'Bérénice Magistretti',
 _tags: '' }
```

---
_Source: https://npm.io/package/metanol · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
