Skip to content

๐Ÿ“š A JavaScript library to parse an URL and convert the article content into Markdown.

License

Notifications You must be signed in to change notification settings

jacqueslorentz/article-down

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

12 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

ArticleDown

๐Ÿ“š A JavaScript library to parse an URL and convert the article content into Markdown.

Getting Started

A library used to fetch a article link and get its content as Markdown, can be linked with pandoc to get other format (pdf, epub, rtf,..).

Install

yarn add jacqueslorentz/article-down

or

npm install --save jacqueslorentz/article-down

Usage

Usage example:

const articledown = require('article-down');

(async () => {
  const link = 'YOUR-ARTICLE-URL';
  try {
    const markdown = await articledown(link); // Returns a promise
    console.log(markdown);
  } catch (err) {
    console.error(err);
  }
})();

The function will return a promise which fulfilled this object:

{
  title: 'Article title',
  titleMarkdown: 'Article title in Markdown',
  source: 'Article source (author and/or website)',
  sourceMarkdown: 'Article source in Markdown',
  link: 'Article link',
  article: 'Article content in Markdown',
}

You can also use the binary, it will save the article in a Markdown file:

node bin.js 'YOUR-ARTICLE-URL' [-d 'output directory'] [-o 'filename']

Running the tests

yarn run test

or

npm run test

Run Eslint to check syntax and Jest to run tests.

Built With

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Jacques Lorentz

About

๐Ÿ“š A JavaScript library to parse an URL and convert the article content into Markdown.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published