@nitunity/api-compiler
Advanced tools
Comparing version 0.0.4 to 0.0.5
const fs = require('fs') | ||
const path = require('path') | ||
module.exports.destroy = () => { | ||
module.exports.destroy = async (object) => { | ||
await posts(object) | ||
await categories(object) | ||
await home(object) | ||
} | ||
let home = (object) => { | ||
let home = fs.readdirSync(`${object.cache}/home`) | ||
let html = home.filter((file) => { | ||
return file.includes('.html') | ||
}) | ||
html.map((file) => { | ||
fs.unlinkSync(`${object.cache}/home/${file}`) | ||
}) | ||
} | ||
let posts = (object) => { | ||
let posts = fs.readdirSync(`${object.cache}/posts`) | ||
let html = posts.filter((file) => { | ||
return file.includes('.html') | ||
}) | ||
html.map((file) => { | ||
fs.unlinkSync(`${object.cache}/posts/${file}`) | ||
}) | ||
} | ||
let categories = (object) => { | ||
let categories = fs.readdirSync(`${object.cache}/categories`) | ||
let html = categories.filter((file) => { | ||
return file.includes('.html') | ||
}) | ||
html.map((file) => { | ||
fs.unlinkSync(`${object.cache}/categories/${file}`) | ||
}) | ||
} |
{ | ||
"name": "@nitunity/api-compiler", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "This package is API for compiling HTML templates using Nunjucks template engine", | ||
@@ -9,3 +9,2 @@ "main": "index.js", | ||
"private": false, | ||
"publishConfig": {}, | ||
"dependencies": { | ||
@@ -12,0 +11,0 @@ "dotenv": "^8.1.0", |
5568
160