Let's start with a simple "front-door" to our script in cli.js that
yargs
.env
file with dotenv
Let's start by just learning how to create files with node's fs
module (docs here). Let's create a simple markdown string, for now, and then save it as a file.
const fs = require('fs');
const cp = require('child_process');
const myPlaceholderMarkdown = `
# TITLE
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam luctus neque non nisi placerat, sodales ullamcorper nulla sodales.
`
const myTool = function(options){
fs.writeFileSync(`${ROOT_DIR}/data/test.md`, myPlaceholderMarkdown);
cp.spawn('open', ['-a', 'Atom', `${ROOT_DIR}/data/test.md`])
}
module.exports = myTool;