Skip to content

Instantly share code, notes, and snippets.

View magalhini's full-sized avatar

Ricardo Magalhães magalhini

View GitHub Profile
@magalhini
magalhini / yamltojson.js
Created July 19, 2020 20:05
YAML with Markdown to JSON
import yamlhead from "yamlhead";
import marked from "marked";
const path = require("path");
const fs = require("fs");
const directoryPath = path.join(__dirname, "../data");
async function readDir() {
try {
@magalhini
magalhini / index.mjs
Created December 24, 2022 17:09
Fetch your Revue newsletter issues
// Usage: node index.mjs YOUR_API_KEY
import fetch from "node-fetch";
import fs from "fs";
async function fetchRevueData(key) {
const response = await fetch("https://www.getrevue.co/api/v2/issues", {
headers: {
Authorization: `Token ${key}`,
},