Add node-chartist support
This commit is contained in:
1179
package-lock.json
generated
1179
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -37,6 +37,7 @@
|
|||||||
"jimp": "^0.16.1",
|
"jimp": "^0.16.1",
|
||||||
"js-yaml": "^4.0.0",
|
"js-yaml": "^4.0.0",
|
||||||
"memory-cache": "^0.2.0",
|
"memory-cache": "^0.2.0",
|
||||||
|
"node-chartist": "^1.0.5",
|
||||||
"open-graph-scraper": "^4.7.1",
|
"open-graph-scraper": "^4.7.1",
|
||||||
"prismjs": "^1.23.0",
|
"prismjs": "^1.23.0",
|
||||||
"puppeteer": "^8.0.0",
|
"puppeteer": "^8.0.0",
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
import jimp from "jimp"
|
import jimp from "jimp"
|
||||||
import opengraph from "open-graph-scraper"
|
import opengraph from "open-graph-scraper"
|
||||||
import rss from "rss-parser"
|
import rss from "rss-parser"
|
||||||
|
import nodechartist from "node-chartist"
|
||||||
|
|
||||||
//Exports
|
//Exports
|
||||||
export {fs, os, paths, url, util, processes, axios, puppeteer, git, opengraph, rss}
|
export {fs, os, paths, url, util, processes, axios, puppeteer, git, opengraph, rss}
|
||||||
@@ -97,6 +98,13 @@
|
|||||||
.replace(/&/g, u["&"] ? "&" : "&")
|
.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 */
|
/**Run command */
|
||||||
export async function run(command, options, {prefixed = true} = {}) {
|
export async function run(command, options, {prefixed = true} = {}) {
|
||||||
const prefix = {win32:"wsl"}[process.platform] ?? ""
|
const prefix = {win32:"wsl"}[process.platform] ?? ""
|
||||||
|
|||||||
Reference in New Issue
Block a user