1.3.3 • Published 4 years ago

fetch-to-markdown v1.3.3

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

Blog Fetch to Markdown

Contributors Forks Stargazers Issues Language grade: JavaScript Maintenance David Dependencies Status License: MIT FOSSA Status LinkedIn Twitter: HoukasaurusRex

Fetch markdown content from api and write to files with frontmatter and component appending support.

Check it out »

Report BugRequest Feature

Table of Contents

About The Project

Fetch to Markdown solves a common problem when working with a headless CMS by simply fetching your content at a provided api endpoint and writing to markdown files. It supports writing custom frontmatter and appending component tags to each file.

☕️ Usage

Usage is simple and assumes a REST api endpoint.

First install the module

npm install fetch-to-markdown

yarn add fetch-to-markdown

Download from a single resource

const { fetchToMarkdown } = require('fetch-to-markdown')

fetchToMarkdown('https://www.cms-backend.com', 'articles' {
  contentDir: 'public' // the directory to write files relative to project root (defaults to 'content')
}),

Or from multiple resources at once

const { fetchToMarkdown } = require('fetch-to-markdown')
const contentAPI = 'https://www.cms-backend.com'

Promise.all([
  fetchToMarkdown(contentAPI, 'articles', {
    components: articleComponents,
  }),
  fetchToMarkdown(contentAPI, 'projects', {
    readme: `Write a custom README.md file in the /projects directory`,
  }),
  fetchToMarkdown(contentAPI, 'companies'),
  fetchToMarkdown(contentAPI, 'links'),
  fetchToMarkdown(contentAPI, 'about'),
  fetchToMarkdown(contentAPI, 'landing', {
    components: landingComponents,
    landing: true // writes file
  }),
])

🤝 Contributing

Want to make a change? Any contributions you make are greatly appreciated.

Check out the issues page

🗺 Roadmap

See the open issues for a list of proposed features (and known issues)

📦 Dependencies

FOSSA Status

1.3.3

4 years ago

1.3.2

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.1

5 years ago

1.1.9

5 years ago

1.1.8

5 years ago

1.1.7

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.0.0

5 years ago