Rory's Blog
Home
Blog
Projects
Facebook
Google+
Github
RSS

Minimist.js

09/20/15

So, now that I'm getting back into node.js script tinkering, I am looking into argument-parsing libraries for node. The one I'll be playing with for now is minimist, which looks... functional. In a minimalist sort of way.

What I would like is something pretty similar to python's argparse, but I don't believe there's anything of....

Here is a "full port" of argparse from python into javascript. There might be value in using it, if it works well enough. Python is the language I use at work, and argparse is something I could be more familiar with.

Hmmm....

In any case, what I'll be using it for is a smarter post/index generator. Right now it takes all the old posts and generates them into the current blog index page. This isn't as fast as I'd like. It also redoes a lot of work everytime that it very rarely needs to do, namely regrabbing all the posts that have already been added to the index page. The idea will be to have the script see what posts need to be added, and only add those. In the rare case I edit a past post and update it (like I will do for various early posts soon), I'll feed in a flag that regenerates the entire index page from scratch.

In any case, my view area is now holding copies of all my published posts, containing only the RSS description (for those that have RSS items), title, publish-date, and the blog content.

Hopefully, I can now regenerate the html files, blog index page, and the RSS file from these posts. That'll be the next step. From there, I need to setup my inprogress area to write posts in the minimal setup, and have it automatically add the date and such. Updating the publishing script shouldn't be too difficult, though.