Fleshing Out v.0.1
Version 0.1 is still being written. I don't have a timeline for its completion. Still learning and reading the docs of the libraries I've used, and reasoning about ways to build this thing with three separate libraries.
Building my first OS command line tool has proven to be fun, difficult, yet satisfying.
I'm basically working with vanilla JS here, and my code looks awful. I'm sure I'm doing something wrong however it's early and I am still building it.
I've got small framework:
commander.js
:
#!/usr/bin/env node
const program = require('commander');
program
.version(package.version)
.command('check <file ...>')
.alias('c')
.description('checkyoself-cli is a grammar and spelling checker for your markdown blog posts.')
.option('-s --spell <module>',
'just check the spelling. '
)
.option('-g --grammar',
'just check the grammar'
)
.program.parse(process.argv);
spellcheck.js
:
const spell = require('spell-checker-js');
module.exports = function spellcheck(text) {
spell.load('en');
const input = [];
input.push(text);
const check = spell.check(input);
return check;
};
module.exports.markdown = require('./lib/remove-markdown');
The spellcheck.js
file was the most straightforward to build however I'm not really sure this is going to work and I have a very minimal sketch of the tool itself.
An interesting conundrum, when all your fundamentals go out the window.
But doing a bit of Google never hurts anyone. So thus, I continue.