Add node-chartist support
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
import jimp from "jimp"
|
||||
import opengraph from "open-graph-scraper"
|
||||
import rss from "rss-parser"
|
||||
import nodechartist from "node-chartist"
|
||||
|
||||
//Exports
|
||||
export {fs, os, paths, url, util, processes, axios, puppeteer, git, opengraph, rss}
|
||||
@@ -97,6 +98,13 @@
|
||||
.replace(/&/g, u["&"] ? "&" : "&")
|
||||
}
|
||||
|
||||
/** Chartist */
|
||||
export async function chartist() {
|
||||
const css = `<style>${await fs.readFile(paths.join(__module(import.meta.url), "../../../node_modules", "node-chartist/dist/main.css")).catch(_ => "")}</style>`
|
||||
return (await nodechartist(...arguments))
|
||||
.replace(/class="ct-chart-line">/, `class="ct-chart-line">${css}`)
|
||||
}
|
||||
|
||||
/**Run command */
|
||||
export async function run(command, options, {prefixed = true} = {}) {
|
||||
const prefix = {win32:"wsl"}[process.platform] ?? ""
|
||||
|
||||
Reference in New Issue
Block a user