Skip to content

Instantly share code, notes, and snippets.

View kartiknair's full-sized avatar

Kartik Nair kartiknair

View GitHub Profile
const config = require("./config");
const posts = fs
.readdirSync(config.dev.postsdir)
.map(post => post.slice(0, -3));
console.log(posts);
const config = {
dev: {
postsdir: "./content",
outdir: "./public"
}
};
module.exports = config;
{
"name": "planar",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"build": "node ./src/index.js"
},
"keywords": [],
"author": "",
mkdir node-ssg && cd node-ssg
npm init -y